boost::interprocess::string has a standard c_str() method. I found the following here:
//! <b>Returns</b>: Returns a pointer to a null-terminated array of characters
//! representing the string's contents. For any string s it is guaranteed
//! that the first s.size() characters in the array pointed to by s.c_str()
//! are equal to the character in s, and that s.c_str()[s.size()] is a null
//! character. Note, however, that it not necessarily the first null character.
//! Characters within a string are permitted to be null.
const CharT* c_str() const
{ return containers_detail::get_pointer(this->priv_addr()); }
(That's for the basic_string
. string
is a template instantiation in which the CharT
template parameter is char
.)
Also, the documentation here says
basic_string is the implementation of
std::basic_string ready to be used in
managed memory segments like shared
memory. It's implemented using a
vector-like contiguous storage, so it
has fast c string conversion...