
Hi, is_iless works with characters, not strings. So you cannot use it to compare std::string keys. Regards, Pavol Boris wrote:
Am I supposed to be able to use boost::algorithm::is_iless (see http://www.boost.org/doc/html/boost/algorithm/is_iless.html) to create a map with case-insensitive keys? I wonder as either it is broken in VS2005 or I do something wrong:
#include <boost/algorithm/string.hpp> #include <string> #include <map>
int main() { std::map<std::string, int, boost::algorithm::is_iless> m; m["test"] = 1; }
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(583) : error C2440: 'type cast' : cannot convert from 'unsigned char' to 'std::basic_string<_Elem,_Traits,_Ax>' ... C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(561) : error C2440: 'type cast' : cannot convert from 'std::basic_string<_Elem,_Traits,_Ax>' to 'unsigned char'
The assignment causes the problem. If you use insert() you get the same compiler error. Without the assignment the code compiles fine.
Boris
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users