Boost logo

Boost Users :

From: Boris (boriss_at_[hidden])
Date: 2007-10-06 13:46:46


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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net