[Boost-bugs] [Boost C++ Libraries] #3229: boost::scoped_ptr second parameter with delete operations

Subject: [Boost-bugs] [Boost C++ Libraries] #3229: boost::scoped_ptr second parameter with delete operations
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-28 19:13:46


#3229: boost::scoped_ptr second parameter with delete operations
------------------------------------------+---------------------------------
 Reporter: Stepan Koltsov <yozh@…> | Owner: pdimov
     Type: Feature Requests | Status: new
Milestone: Boost 1.40.0 | Component: smart_ptr
  Version: Boost 1.39.0 | Severity: Not Applicable
 Keywords: |
------------------------------------------+---------------------------------
 Requesting second parameter of scoped_ptr (and other smart pointers)
 templates, specifying destroy operation for pointer. Something like this
 (simplified code):

 {{{
 template <class T>
 struct destroy_delete {
   static void destroy(T* t) { delete t; }
 };

 template <class T, class D = destroy_delete>
 class scoped_ptr {
   ~scoped_ptr() {
     D::destroy(px);
   }
 };


 // this I can use in my code
 template <class T>
 struct destroy_free {
   static void destroy(T* t) { free(t); }
 };

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3229>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC