issues appending strings
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.
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:
std::wstring::append() expects std::wstring as its argument, not std::string;
Hi: I realize that, sorted, that’s what being visually challenged does! Sean. From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: 21 October 2009 11:06 To: boost-users@lists.boost.org Subject: Re: [Boost-users] issues appending strings 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: std::wstring::append() expects std::wstring as its argument, not std::string;
participants (2)
-
Igor R
-
Sean Farrow