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:
...so then I can do something like this:Code:operator std::wstring( std::string a ) { std::wstring b; // conversion code here return b; }
Obviously, my attempt failed. But is this even possible?Code:std::string Text( "This is text." ); std::wstring WideText = Text;
Thanks.



LinkBack URL
About LinkBacks


