Boost logo

Boost Users :

Subject: Re: [Boost-users] scoped_ptr with destructor function
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2008-12-04 13:58:16


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net