|
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:47:43
manish4gupta wrote:
> 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.
Hi,
sorry, but that is not even close to a minimal example.
Your problem is somewhere here (as you stated in another mail):
std::string s = "test"; // OK
char_string cs(s.c_str(), alloc_inst); // OK and thanks
string y = (char_string) cs; // pblm
Is you could send a sample program with just these lines in the main
function and the required includes/typedefs.
Nothing more. Lets focus on the problem, please.
Regards,
Roland
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