id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 924,Convenience function for const map read,nobody,,"It's really awkward to use an STL map when you have only a const reference to it, because you cannot use operator[] -- you have to use find, check if the value was found, etc. (The reason being that operator[] creates a new map entry initialized with the null value if it doesn't find the key.) It would be much more convenient to have a lookup convenience function that either throws an exception if the key doesn't exist, or returns a default-initialized value. The version that returns a default value if the key doesn't exist might look something like this: {{{ template typename Map::data_type const & map_get(Map const & m, typename Map::key_type key) { static typename Map::data_type default_value; typename Map::const_iterator it = m.find(key); return (it == m.end() ? default_value : it->second); } }}}",Feature Requests,closed,To Be Determined,None,Boost 1.34.0,Optimization,invalid,,