[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-bugs
Subject:    [Boost-bugs] [Boost C++ Libraries] #3229: boost::scoped_ptr second
From:       "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date:       2009-06-28 19:13:46
Message-ID: 061.fb3255c18da15047cfd666245267ea8b () lists ! boost ! org
[Download RAW message or body]

#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.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic