Boost logo

Boost Users :

Subject: Re: [Boost-users] How to convert std::string into basic_string
From: Roland Bock (rbock_at_[hidden])
Date: 2009-09-17 04:14:13


Hi,

can you please send a small but complete sample code of what you are
trying (a bunch of includes and a main function, not more than a few lines)?

Regards,

Roland

manish4gupta wrote:
> I have tried both but i am getting the following error message
>
> In constructor ‘boost::interprocess_container::basic_string<CharT, Traits,
> Alloc>::basic_string(const CharT*, const A&) [with CharT = char, Traits =
> std::char_traits<char>, A = boost::interprocess::allocator<char,
> boost::interprocess::segment_manager<char,
> boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
> boost::interprocess::offset_ptr<void>, 0u>, boost::interprocess::iset_index>
>> ]’:
> run.cpp:63: error: no matching function for call to
> ‘boost::interprocess::allocator<char,
> boost::interprocess::segment_manager<char,
> boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
> boost::interprocess::offset_ptr<void>, 0u>, boost::interprocess::iset_index>
>> ::allocator()’
> /usr/include/boost/interprocess/allocators/allocator.hpp:129: note:
> candidates are: boost::interprocess::allocator<T,
> SegmentManager>::allocator(const boost::interprocess::allocator<T,
> SegmentManager>&) [with T = char, SegmentManager =
> boost::interprocess::segment_manager<char,
> boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
> boost::interprocess::offset_ptr<void>, 0u>,
> boost::interprocess::iset_index>]
> /usr/include/boost/interprocess/allocators/allocator.hpp:124: note:
> boost::interprocess::allocator<T,
> SegmentManager>::allocator(SegmentManager*) [with T = char, SegmentManager =
> boost::interprocess::segment_manager<char,
> boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
> boost::interprocess::offset_ptr<void>, 0u>,
> boost::interprocess::iset_index>]
>
>
>
> Igor R wrote:
>>> This is ok but i have to convert string into boost string.
>> You mean Boost.Interprocess string.
>>
>> std::string s1("test");
>>
>> char_string s2(s1.begin(), s1.end());
>> or:
>> char_string s2(s1.c_str());
>> _______________________________________________
>> 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