Boost logo

Boost Users :

From: p.klotz_at_[hidden]
Date: 2003-03-21 08:15:50


The code fragment below does not compile. The problem seems to be related
to wide character support.
MSVC6 works without problems.

#include <boost/lexical_cast.hpp>
int main(void)
{
    boost::lexical_cast<std::string,unsigned short>(4);
    return 0;
}

Here are the resulting error messages:

C:\devel\BOOST\1.30.0\win32-msvc7\include\boost\lexical_cast.hpp(162) :
error C2679: binary '=' : no operator found which takes a right-hand
operand of type 'std::basic_stringstream<_Elem,_Traits,_Alloc>::_Mystr' (or
there is no acceptable conversion)
        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits<wchar_t>,
            _Alloc=std::allocator<wchar_t>
        ]
        C:\devel\BOOST\1.30.0
\win32-msvc7\include\boost\lexical_cast.hpp(158) : while compiling
class-template member function 'bool
boost::detail::lexical_stream<Target,Source>::operator >>(std::string &)'
        with
        [
            Target=std::string,
            Source=unsigned short
        ]
        C:\devel\BOOST\1.30.0
\win32-msvc7\include\boost\lexical_cast.hpp(190) : see reference to class
template instantiation 'boost::detail::lexical_stream<Target,Source>' being
compiled
        with
        [
            Target=std::string,
            Source=unsigned short
        ]
        C:\devel\ICOSOFT\PROJECTS\Applications\H\HelloWorld\main.cpp(5) :
see reference to function template instantiation 'Target
boost::lexical_cast?$@V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@G(Source)'
 being compiled

        with
        [
            Target=std::string,
            Source=unsigned short
        ]

Best regards, Peter.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net