I am trying to store the index file (keyword , position) where keyword is
string while position is long. But before doing that i am doing some
benchmarking for the given code in which map is created as key, value.
Where key is char_string (typedef of basic_string) but when i read the data
using C++, it will be string. So my intention is to convert string into
char_string. For that i am testing to convert std:: string s = "test" into
char_string. But getting the error message. Please do help me.
#include
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
::basic_string(const CharT*, const A&) [with CharT = char, Traits = std::char_traits<char>, A = boost::interprocess::allocator , boost::interprocess::iset_index> ]’: run.cpp:63: error: no matching function for call to ‘boost::interprocess::allocator
, boost::interprocess::iset_index> ::allocator()’ /usr/include/boost/interprocess/allocators/allocator.hpp:129: note: candidates are: boost::interprocess::allocator ::allocator(const boost::interprocess::allocator &) [with T = char, SegmentManager = boost::interprocess::segment_manager , boost::interprocess::iset_index>] /usr/include/boost/interprocess/allocators/allocator.hpp:124: note: boost::interprocess::allocator ::allocator(SegmentManager*) [with T = char, SegmentManager = boost::interprocess::segment_manager , 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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-tp254... Sent from the Boost - Users mailing list archive at Nabble.com.