I wan't to convert an std::string to a std::wstring. To make things easier, I want to overload the conversion operator to make it more simplified but I don't want to encapsulate in my own class. Here's sort of how I'd imagine it to be implemented:
Code:
operator std::wstring( std::string a )
{
std::wstring b;
// conversion code here
return b;
}
...so then I can do something like this:
Code:
std::string Text( "This is text." );
std::wstring WideText = Text;
Obviously, my attempt failed. But is this even possible?
Thanks.