Boost C++ Libraries: Ticket #8976: interprocess::shared_ptr fails to compile if used with a scoped_allocator https://svn.boost.org/trac10/ticket/8976 <p> The following code will fail to compile using at least gcc 4.6.3 </p> <pre class="wiki">#include &lt;memory&gt; #include &lt;boost/container/scoped_allocator.hpp&gt; #include &lt;boost/interprocess/smart_ptr/shared_ptr.hpp&gt; namespace bip=boost::interprocess; int main(int argc, char* argv[]) { class MyDeleter { public: typedef std::allocator&lt;void&gt;::pointer pointer; void operator()(const pointer&amp; ptr){}; }; typedef boost::container::scoped_allocator_adaptor&lt; std::allocator&lt;void&gt; &gt; Allocator; Allocator alloc; // next line will fail to compile due to a inaccessible base type error bip::shared_ptr&lt;int,Allocator::outer_allocator_type,MyDeleter&gt; test1(new int(),alloc); //using the outer_allocator will work fine bip::shared_ptr&lt;int,Allocator::outer_allocator_type,MyDeleter&gt; test2(new int(),alloc); }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8976 Trac 1.4.3 Markus Mathes <Markus.Mathes@…> Thu, 08 Aug 2013 15:13:38 GMT <link>https://svn.boost.org/trac10/ticket/8976#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8976#comment:1</guid> <description> <p> Typo while copying the code. The line to fail must read: </p> <pre class="wiki">// next line will fail to compile due to a inaccessible base type error bip::shared_ptr&lt;int,Allocator,MyDeleter&gt; test1(new int(),alloc); </pre> </description> <category>Ticket</category> </item> <item> <author>Markus Mathes <Markus.Mathes@…></author> <pubDate>Fri, 06 Sep 2013 15:40:09 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8976 https://svn.boost.org/trac10/ticket/8976 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">interprocess_shared_ptr_scoped_alloc.patch</span> </li> </ul> <p> quick hack </p> Ticket Markus Mathes <Markus.Mathes@…> Fri, 06 Sep 2013 15:59:51 GMT <link>https://svn.boost.org/trac10/ticket/8976#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8976#comment:2</guid> <description> <p> Another workaround ist to use: </p> <pre class="wiki">boost::interprocess:shared_ptr&lt;int,container::outermost_allocator&lt;Allocator&gt;::type,MyDeleter&gt; </pre><p> to remove the scoped allocator capabilities which anyway are not needed ... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Fri, 06 Sep 2013 21:23:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8976#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8976#comment:3</guid> <description> <p> Thanks for the report, the problem was in the "destroy" function, where a proper static_cast was needed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Fri, 06 Sep 2013 21:24:38 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8976#comment:4 https://svn.boost.org/trac10/ticket/8976#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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85587" title="Fixes #8976 ">[85587]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8976" title="#8976: Bugs: interprocess::shared_ptr fails to compile if used with a scoped_allocator (closed: fixed)">#8976</a> </p> Ticket Markus.Mathes@… Fri, 06 Sep 2013 21:59:51 GMT <link>https://svn.boost.org/trac10/ticket/8976#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8976#comment:5</guid> <description> <p> Thanks for fixing! </p> </description> <category>Ticket</category> </item> </channel> </rss>