Boost logo

Boost Users :

Subject: Re: [Boost-users] How to convert std::string into basic_string
From: manish4gupta (manish_at_[hidden])
Date: 2009-09-17 03:55:31


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
>
>

-- 
View this message in context: http://www.nabble.com/How-to-convert-std%3A%3Astring-into-basic_string-tp25446943p25486783.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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