
On 4/15/06, Reece Dunn <msclrhd@hotmail.com> wrote:
What about converting to different string types, mainly std::string or std::wstring?
I am also working on implementing to_string and string_to :). Maybe we could combine our efforts and get to_string/string_to into Boost.
At the moment, my versions don't have locale support and string_to isn't returning optional<T>, although I am working on it. They can be used like this:
print( boost::to_string< char >( 10 )); // returns std::string print( boost::to_string< char >( 10.01 )); print( boost::to_string< wchar_t >( 10 )); // returns std::wstring print( boost::to_string< wchar_t >( 10.01 ));
The template parameter doesn't look nice (IMO). What about to_basic_string<T> and to_string as alias for to_basic_string<char> and to_wstring as alias for to_basic_string<wchat_t>? But then you're still limited to basic_string. Can't you make one that can use other containers?