scoped_ptr with destructor function
Does boost have something lightweight like a scoped_ptr but that lets you specify a custom delete function, or do I have to use a shared_ptr for that? Thanks, Jason
On Thu, Dec 4, 2008 at 1:02 PM, Steven Watanabe
AMDG
Jason Cipriani wrote:
Does boost have something lightweight like a scoped_ptr but that lets you specify a custom delete function, or do I have to use a shared_ptr for that?
Boost does not contain such a pointer.
All right, thanks! Jason
Jason Cipriani wrote:
Does boost have something lightweight like a scoped_ptr but that lets you specify a custom delete function, or do I have to use a shared_ptr for that?
Thanks, Jason
I don't believe it has been submitted to boost (not sure why not), but there is a unique_ptr implementation at the following link that provides what you want: http://home.twcny.rr.com/hinnant/cpp_extensions/unique_ptr_03.html I think you can just add include guards to that source, throw it in a header called unique_ptr.hpp and call it a day.
On Thu, Dec 4, 2008 at 1:58 PM, Kenny Riddile
Jason Cipriani wrote:
Does boost have something lightweight like a scoped_ptr but that lets you specify a custom delete function, or do I have to use a shared_ptr for that?
I don't believe it has been submitted to boost (not sure why not), but there is a unique_ptr implementation at the following link that provides what you want:
http://home.twcny.rr.com/hinnant/cpp_extensions/unique_ptr_03.html
I think you can just add include guards to that source, throw it in a header called unique_ptr.hpp and call it a day.
Thanks for the link. Jason
participants (3)
-
Jason Cipriani
-
Kenny Riddile
-
Steven Watanabe