Boost logo

Boost :

From: Rodolfo Lima (rodolfo_at_[hidden])
Date: 2003-07-21 09:05:11


I had some problems with lexical_cast and not using wchar_t as a built-in
type. For instance...

std::stringstream ss;
ss << boost::lexical_cast<unsigned short>("23");

lexical_cast would return a wstring, and a compile failure, because
internally there is a the template that matches unsigned short as wchar_t,
which makes lexical_cast return a wstring. Or something like this. The fact
is that this example gives an cryptic compiler error (it was for me):

boost\lexical_cast.hpp(147) : error C2679: binary '<<' : no operator found
which takes a right-hand operand of type 'const
boost::token_iterator_generator<TokenizerFunc,Iterator,Type>::value_type'
(or there is no acceptable conversion)

Maybe to avoid this kind of compiler error message, there's such requirement
of wchar_t being an native type.

regards,
rod


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk