boost::interprocess::string には標準の c_str() メソッドがあります。私はここで以下を見つけました:
//! <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()); }
(これはbasic_string
.がテンプレート パラメータstring
であるテンプレートのインスタンス化のためです。)CharT
char
また、ここのドキュメントには次のように書かれています
basic_string は std::basic_string の実装であり、共有メモリなどのマネージド メモリ セグメントですぐに使用できます。ベクトルのような連続ストレージを使用して実装されているため、高速な c 文字列変換が可能です...