Boost logo

Boost Users :

Subject: [Boost-users] issues appending strings
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2009-10-21 05:56:49


Hi:

I have a std::wstring defined like so:

std::wstring OutputString;

I then use the following code to try to append to it:

OutputString.append(boost::gregorian::to_iso_extended_string(d));

I receive the following errors:

d:\work\access for everyone\ghg\tpproductszw\tpproductszw.cpp(63) :
error C2664: 'std::basic_string<_Elem,_Traits,_Ax>
&std::basic_string<_Elem,_Traits,_Ax>::append(const
std::basic_string<_Elem,_Traits,_Ax> &)' : cannot convert parameter 1
from 'std::string' to 'const std::basic_string<_Elem,_Traits,_Ax> &'

        with

        [

            _Elem=wchar_t,

            _Traits=std::char_traits,

            _Ax=std::allocator

        ]

        Reason: cannot convert from 'std::string' to 'const
std::basic_string<_Elem,_Traits,_Ax>'

        with

        [

            _Elem=wchar_t,

            _Traits=std::char_traits,

            _Ax=std::allocator

        ]

        No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called

Using visual c++ 2008 on a windows xp sp3 box.

What's happening here, and more importantly what am I doing wrong/or not
doing as the case may be?

Cheers

Sean.



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