Function deconstruct_ptr

boost::deconstruct_ptr — Create a shared_ptr which supports post-constructors and pre-destructors.

Synopsis

template<typename T> shared_ptr<T> deconstruct_ptr(T* pointer);
template<typename T, typename D> 
  shared_ptr<T> deconstruct_ptr(T* pointer, D deleter);

Description

Effects:

Creates a shared_ptr<T> by passing the pointer and deleter parameters to the shared_ptr constructor. If no deleter is specified, then predestructing_deleter is used as the default. If T is derived from postconstructible (and pointer is not a null pointer), then pointer->postconstruct() will be called after the shared_ptr is constructed.

Returns:

A shared_ptr<T> owning pointer.