Boost C++ Libraries: Ticket #12763: Provide a way to specify a default disposer https://svn.boost.org/trac10/ticket/12763 <p> It would be convenient if there was a way to specify a default disposer to be applied to elements stored in an intrusive container. This would make it easier to write containers that take ownership of their inserted elements. </p> <p> This would impact the container's destructor as well as the methods <code>erase</code>, <code>erase_after</code>, <code>clear</code>, <code>remove</code>, <code>remove_if</code>, <code>pop_front</code>, <code>pop_back</code>, <code>assign</code>, <code>unique</code> and <code>clone_from</code>. </p> <p> The library should probably provide a no-op disposer, which would be the default one used by intrusive containers. Particular care should be taken in <code>clear</code> and containers' destructors in order to avoid calling the no-op disposer for every element. </p> <p> For example: </p> <pre class="wiki">boost::intrusive::list&lt;MyElement, boost::intrusive::disposer&lt;std::default_delete&lt;MyElement&gt;&gt;&gt; elems; elems.insert(*new MyElement); // Clearing the collection deletes the elements. elems.clear(); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12763 Trac 1.4.3 fdegros@… Mon, 27 Feb 2017 05:38:35 GMT <link>https://svn.boost.org/trac10/ticket/12763#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12763#comment:1</guid> <description> <p> Ping? Any idea or progress on this topic? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 28 Feb 2017 20:59:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12763#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12763#comment:2</guid> <description> <p> Configuring the deleter would require also a cloner for some functions. Maybe a wrapper class that manages memory could be helpful, but I have no clear idea on what's the best approach. </p> </description> <category>Ticket</category> </item> <item> <author>fdegros@…</author> <pubDate>Wed, 26 Jul 2017 00:21:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12763#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12763#comment:3</guid> <description> <p> Where would a cloner be required if we had a default deleter? </p> </description> <category>Ticket</category> </item> </channel> </rss>