
21 Mar
2006
21 Mar
'06
4:29 p.m.
Hello! I have to convert a std::wstring to a std::string and tried the following small test program. #include <iostream> #include <string> #include <boost/lexical_cast.hpp> int main(int argc, char** argv) { std::wstring ws(L"Hello"); std::string s(boost::lexical_cast<std::string>(ws); std::cout << s << std::endl; return 0; } But this will not compile on MSVC8.0 or MSVC7.1. Is the boost::lexical_cast suppost to handle this conversion? Thanks, Thomas Gulbrandsen