Missing functions in lexical_cast

I would like to convert between std::wstring and std::string using
lexical_cast and finally discovered in an old posting that you must
manually provide template specializations for these types as below. My
question is why these aren't provided in lexical_cast.hpp already?
template<> inline std::wstring boost::lexical_cast(std::string source)
{
std::wstring result(source.size(), wchar_t(0));
typedef std::ctype

I'm not against the idea of lexical_cast providing std::wstring <->
std::string conversions. However, I think if lexical_cast were to provide
this functionality it would make sense for it to be able to perform
conversions for any locale (argument) and conversions between UTF-8 <->
UTF-16. Otherwise one would need yet another class to perform these
conversions. Personally I think a string_cast class may make more sense.
Just my 2 cents
-delfin
_____
From: boost-users-bounces@lists.boost.org
[mailto:boost-users-bounces@lists.boost.org] On Behalf Of Sean Rohead
Sent: Friday, July 22, 2005 5:13 PM
To: boost-users@lists.boost.org
Subject: [Boost-users] Missing functions in lexical_cast
I would like to convert between std::wstring and std::string using
lexical_cast and finally discovered in an old posting that you must manually
provide template specializations for these types as below. My question is
why these aren't provided in lexical_cast.hpp already?
template<> inline std::wstring boost::lexical_cast(std::string source)
{
std::wstring result(source.size(), wchar_t(0));
typedef std::ctype
participants (2)
-
Delfin Rojas
-
Sean Rohead