Boost C++ Libraries: Ticket #3229: boost::scoped_ptr second parameter with delete operations https://svn.boost.org/trac10/ticket/3229 <p> Requesting second parameter of scoped_ptr (and other smart pointers) templates, specifying destroy operation for pointer. Something like this (simplified code): </p> <pre class="wiki">template &lt;class T&gt; struct destroy_delete { static void destroy(T* t) { delete t; } }; template &lt;class T, class D = destroy_delete&gt; class scoped_ptr { ~scoped_ptr() { D::destroy(px); } }; // this I can use in my code template &lt;class T&gt; struct destroy_free { static void destroy(T* t) { free(t); } }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3229 Trac 1.4.3 Peter Dimov Tue, 01 Dec 2009 01:50:01 GMT milestone changed https://svn.boost.org/trac10/ticket/3229#comment:1 https://svn.boost.org/trac10/ticket/3229#comment:1 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.40.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket Peter Dimov Wed, 11 Dec 2013 17:43:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3229#comment:2 https://svn.boost.org/trac10/ticket/3229#comment:2 <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">wontfix</span> </li> </ul> <p> std::unique_ptr is the recommended alternative when you need a deleter. </p> Ticket