|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-03-07 13:59:08
From: Nicolai Josuttis <nicolai.josuttis_at_[hidden]>
> template<typename T, typename OP>
> class scoped_resource : noncopyable {
>
> T* ptr;
>
> public:
> typedef T element_type;
>
> explicit scoped_resource( T* p=0 ) throw() : ptr(p) {}
> ~scoped_resource() { OP()(ptr); }
One of the technical issues was whether to make a copy of an OP
argument rather than constructing one in the destructor, which
led to a lot of work on the empty base class optimization. I
lost track of how that work panned out, but the intent was to
apply it back to scoped_ptr and shared_ptr.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk