Boost logo

Boost Users :

Subject: Re: [Boost-users] issue when using boost::tokensizer with std::wstring.
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2011-01-17 21:46:09


Hi:
Ok, This is still not working, I now have:
std::wstring TokensStr(Item);
boost::char_delimiters_separator<wchar_t> sep;
boost::tokenizer<boost::char_delimiters_separator<wchar_t> > tok(TokensStr);
I now have the errors:
     1>c:\program files\boost\boost\tokenizer.hpp(59): error C2664: 'std::_String_const_iterator<_Elem,_Traits,_Alloc>::_String_const_iterator(const std::_String_const_iterator<_Elem,_Traits,_Alloc> &)' : cannot convert parameter 1 from 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' to 'const std::_String_const_iterator<_Elem,_Traits,_Alloc> &'
                 with
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 and
                 [
                     _Elem=wchar_t,
                     _Traits=std::char_traits<wchar_t>,
                     _Alloc=std::allocator<wchar_t>
                 ]
                 and
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 Reason: cannot convert from 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' to 'const std::_String_const_iterator<_Elem,_Traits,_Alloc>'
                 with
                 [
                     _Elem=wchar_t,
                     _Traits=std::char_traits<wchar_t>,
                     _Alloc=std::allocator<wchar_t>
                 ]
                 and
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
                 d:\work\access for everyone\sibelius access\sibeliusaccessserver\sibeliusaccess.cpp(232) : see reference to function template instantiation 'boost::tokenizer<TokenizerFunc>::tokenizer<std::wstring>(const Container &)' being compiled
                 with
                 [
                     TokenizerFunc=boost::char_delimiters_separator<wchar_t>,
                     Container=std::wstring
                 ]
     1>c:\program files\boost\boost\tokenizer.hpp(59): error C2664: 'std::_String_const_iterator<_Elem,_Traits,_Alloc>::_String_const_iterator(const std::_String_const_iterator<_Elem,_Traits,_Alloc> &)' : cannot convert parameter 1 from 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' to 'const std::_String_const_iterator<_Elem,_Traits,_Alloc> &'
                 with
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 and
                 [
                     _Elem=wchar_t,
                     _Traits=std::char_traits<wchar_t>,
                     _Alloc=std::allocator<wchar_t>
                 ]
                 and
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 Reason: cannot convert from 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' to 'const std::_String_const_iterator<_Elem,_Traits,_Alloc>'
                 with
                 [
                     _Elem=wchar_t,
                     _Traits=std::char_traits<wchar_t>,
                     _Alloc=std::allocator<wchar_t>
                 ]
                 and
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>,
                     _Alloc=std::allocator<char>
                 ]
                 No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Any help appreciated, boost 1.45 fyi.
Regards
Sean.
-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Igor R
Sent: 17 January 2011 17:45
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] issue when using boost::tokensizer with std::wstring.

> I get the errors below when trying to compile the following code:
>
> std::wstring TokensStr(Item);
>
>        boost::tokenizer<> Tokens(TokensStr);
>
> Item, is defined as a BSTR.
>
> the errors are:

tokenizer<char_delimiters_separator<wchar_t> > _______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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