Boost logo

Boost :

From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-08-29 14:57:04


On Friday, Aug 29, 2003, at 13:34 America/Denver, E. Gladyshev wrote:
> ...
> All I am trying to say is that shared_ptr doesn't specify
> any requirements on its Deleter parameter.

Bullshit:

   template<class Y, class D> shared_ptr(Y * p, D d);

   Requirements: p must be convertible to T *. D must be
   CopyConstructible. The copy constructor and destructor of D
   must not throw. The expression d(p) must be well-formed, must
   not invoke undefined behavior, and must not throw exceptions.

   Effects: Constructs a shared_ptr that owns the pointer p and
   the deleter d.

   Postconditions: use_count() == 1 && get() == p .

   Throws: std::bad_alloc or an implementation-defined exception
   when a resource other than memory could not be obtained.

   Exception safety: If an exception is thrown, d(p) is called.

   Notes: When the time comes to delete the object pointed to by p,
   the stored copy of d is invoked with the stored copy of p as an
   argument.

http://www.boost.org/libs/smart_ptr/shared_ptr.htm#constructors


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk