Boost C++ Libraries: Ticket #11713: boost::interprocess::basic_string instantiation broken (wrong report - please close ticket!) https://svn.boost.org/trac10/ticket/11713 <p> It appears that instantiation of boost::container::basic_string's with shared memory segment allocators doesn't work in 1.59: </p> <pre class="wiki">#include &lt;boost/interprocess/managed_shared_memory.hpp&gt; #include &lt;boost/interprocess/containers/string.hpp&gt; typedef boost::interprocess::managed_shared_memory::segment_manager SegmentManagerT; typedef boost::interprocess::allocator&lt;char,SegmentManagerT&gt; CharAllocatorT; typedef boost::interprocess::basic_string&lt;char, std::char_traits&lt;char&gt;, CharAllocatorT&gt; StringT; void test2(CharAllocatorT&amp; alloc) { StringT s("", alloc); } </pre><p> Gives error on s instantiation. Using g++ (Ubuntu 4.9.2-10ubuntu13) 4.9.2 </p> <p> This compiles cleanly with Boost 1.57. Haven't tried 1.58 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11713 Trac 1.4.3 kaparis.dimitri@… Wed, 07 Oct 2015 13:35:32 GMT <link>https://svn.boost.org/trac10/ticket/11713#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11713#comment:1</guid> <description> <p> The same problem affects example 33.10 of the chapter on Managed Shared Memory of "The Boost C++ Libraries" book (<a class="ext-link" href="http://theboostcpplibraries.com/boost.interprocess-managed-shared-memory"><span class="icon">​</span>http://theboostcpplibraries.com/boost.interprocess-managed-shared-memory</a>): </p> <pre class="wiki">#include &lt;boost/interprocess/managed_shared_memory.hpp&gt; #include &lt;iostream&gt; using namespace boost::interprocess; int main() { shared_memory_object::remove("Boost"); managed_shared_memory managed_shm{open_or_create, "Boost", 1024}; int *i = managed_shm.construct&lt;int&gt;("Integer")(99); std::cout &lt;&lt; *i &lt;&lt; '\n'; std::pair&lt;int*, std::size_t&gt; p = managed_shm.find&lt;int&gt;("Integer"); if (p.first) std::cout &lt;&lt; *p.first &lt;&lt; '\n'; } </pre> </description> <category>Ticket</category> </item> <item> <author>kaparis.dimitri@…</author> <pubDate>Wed, 07 Oct 2015 13:38:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11713#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11713#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11713#comment:1" title="Comment 1">kaparis.dimitri@…</a>: </p> <blockquote class="citation"> <p> The same problem affects example 33.10 of the chapter on Managed Shared Memory of "The Boost C++ Libraries" book (<a class="ext-link" href="http://theboostcpplibraries.com/boost.interprocess-managed-shared-memory"><span class="icon">​</span>http://theboostcpplibraries.com/boost.interprocess-managed-shared-memory</a>): </p> </blockquote> <p> Sorry, copied wrong example. This is the correct one: </p> <pre class="wiki"> #include &lt;boost/interprocess/managed_shared_memory.hpp&gt; #include &lt;boost/interprocess/allocators/allocator.hpp&gt; #include &lt;boost/interprocess/containers/string.hpp&gt; #include &lt;iostream&gt; using namespace boost::interprocess; int main() { shared_memory_object::remove("Boost"); managed_shared_memory managed_shm{open_or_create, "Boost", 1024}; typedef allocator&lt;char, managed_shared_memory::segment_manager&gt; CharAllocator; typedef basic_string&lt;char, std::char_traits&lt;char&gt;, CharAllocator&gt; string; string *s = managed_shm.find_or_construct&lt;string&gt;("String")("Hello!", managed_shm.get_segment_manager()); s-&gt;insert(5, ", world"); std::cout &lt;&lt; *s &lt;&lt; '\n'; } </pre> </description> <category>Ticket</category> </item> <item> <author>kaparis.dimitri@…</author> <pubDate>Thu, 08 Oct 2015 17:15:33 GMT</pubDate> <title>summary changed https://svn.boost.org/trac10/ticket/11713#comment:3 https://svn.boost.org/trac10/ticket/11713#comment:3 <ul> <li><strong>summary</strong> <span class="trac-field-old">boost::interprocess::basic_string instantiation broken</span> → <span class="trac-field-new">boost::interprocess::basic_string instantiation broken (wrong report - please close ticket!)</span> </li> </ul> <p> Apologies, the error is on my side - it seems I have mixed up some older version headers. </p> <p> Please disregard and close ticket. </p> Ticket Ion Gaztañaga Tue, 27 Oct 2015 08:08:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11713#comment:4 https://svn.boost.org/trac10/ticket/11713#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket