id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2484,Const-overload needed for bimap associative_container_adaptor::count(),mlcreech@…,Matias Capeletto,"Would it be possible to include a const-overloaded version of count() for associative containers in boost::bimaps? I had some code like this: {{{ void CMyClass::func(size_t key) const { size_t num_elements=_member_map.count(key); ... } }}} where _member_map was a std::map, and it worked fine. When I changed _member_map to a bimap, the equivalent code: {{{ void CMyClass::func(size_t key) const { size_t num_elements=_member_map.left.count(key); ... } }}} gives an error, because count() is non-const (whereas GCC's std::map::count() is const). That's presumably done because the STL documentation declares count() as non-const (not sure why), but it doesn't seem there would be any harm in adding a const-overload so that this kind of code would compile when the underlying type supports it. The attached patch fixes the problem for me. Thanks",Patches,closed,Boost 1.38.0,bimap,Boost 1.39.0,Problem,fixed,,