Thomas Gulbrandsen
2006-03-21 16:29:59 UTC
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
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