From: Patrick McCarty Date: Sun, 28 Mar 2010 22:55:51 +0000 (-0700) Subject: Use iterator for STL std::map element access. X-Git-Tag: release/2.13.17-1~13^2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=56cf748c20df5eeadb90b3ead5e965390126dc0f;p=lilypond.git Use iterator for STL std::map element access. The at() function for std::map was added for libstdc++ release 4.1, and it is not part of the official STL. Also some developers are still using libstdc++ 4.0, so using at() will not compile. Instead, use an iterator for std::map element access, which is the standard (albeit annoying) practice. --- diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index de3228dbf4..741f9741fa 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -241,7 +241,16 @@ Open_type_font::name_to_index (string nm) const size_t Open_type_font::index_to_charcode (size_t i) const { - return index_to_charcode_map_.at (i); + map::const_iterator iter; + iter = index_to_charcode_map_.find (i); + + if (iter != index_to_charcode_map_.end ()) + return (size_t) iter->second; + else + { + programming_error (_ ("Invalid index for character")); + return 0; + } } size_t