
Hi: Does boost work with std::wstring? Also is there a way to tell c++ to use std::wstring when instanciating an std::string? Cheers Sean.

Sean Farrow wrote:
Does boost work with std::wstring?
Why not? Boost provides a bunch of function and class templates that work for any character-like type. See e.g. the String-Algo library http://www.boost.org/doc/libs/1_37_0/doc/html/string_algo.html or the file-system library http://www.boost.org/doc/libs/1_37_0/libs/filesystem/doc/index.htm
Also is there a way to tell c++ to use std::wstring when instanciating an std::string?
This has nothing to do with C++. std::string is a typedef for std::basic_string<char> and std::wstring is some such for std::basic_string<wchar_t>. char and wchar_t are distinct types, so no such instantiation replacement makes sense. You probably come from MFC world with some TCHAR #define. If you prefer this, just define your own tstring like this: typedef std::basic_string<TCHAR> tstring; and you are done (proper include's implied). HTH & Greetings from Bremen, Daniel Krügler
participants (2)
-
Daniel Krügler
-
Sean Farrow