Problem with boost ::interprocess::string

On Thursday, December 22, 2011 11:42 AM, Josmon Paul wrote:
By default, boost::interprocess::string uses the standard (non-interprocess) allocator. Below 10 characters, the string doesn't allocate any additional storage; it stores the string in the string object itself. Beyond 10 characters, it allocates a buffer to store the string. If you're storing the string in a shared region (which I assume you are), you need to use the following string type: boost::interprocess::basic_string <char, std::char_traits <char>, same_allocator_type_as_your_vector> Then, each time you construct a string, pass the same instance of that allocator as you passed to the vector's constructor.

El 22/12/2011 17:42, Josmon Paul escribió:
Ti see how to allocate something "complex" like a vector of strings, please see documentation: http://www.boost.org/doc/libs/1_48_0/doc/html/interprocess/allocators_contai... Best, Ion
participants (3)
-
Andrew Holden
-
Ion Gaztañaga
-
Josmon Paul