Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-08-29 16:14:12

--- Gregory Colvin <gregory.colvin_at_[hidden]> wrote:

> 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.

Well said. :) Sorry about that.

I looked at the "Common Requirements" section
and description of shared_ptr::reset();

template<class Y, class D> void reset(Y * p, D d);
Effects: Equivalent to shared_ptr(p, d).swap(*this).

Somehow I missed the constructor docs.
Sorry again.

Anyway like I said before several times
it is not a big deal in my opinion.
People are adopted to follow similar
requirements for STL allocators anyway.

I guess they can be recommended to all boost
authors who wants to make memory management
data types.

Perhaps they can be added to the "Guidlines" section


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Boost list run by bdawes at, gregod at, cpdaniel at, john at