
22 Mar
2003
22 Mar
'03
11:42 p.m.
The code fragment below does not compile. The problem seems to be related to wide character support. MSVC6 works without problems.
#include <boost/lexical_cast.hpp> int main(void) { boost::lexical_cast<std::string,unsigned short>(4); return 0; }
Meanwhile I found the cause of the problem. wchar_t is mapped to unsigned short by default when using MSVC7. To solve the problem, use the compiler flag /Zc:wchar_t. This makes wchar_t a type of its own, independent of unsigned short. So the template specialization for wchar_t is not used and the above code compiles. Best regards, Peter.