#include <stlsoft/smartptr/shared_ptr.hpp>
T | The value type |
Public Types | |
Types | |
typedef T | value_type |
typedef value_type * | pointer |
typedef value_type const * | const_pointer |
typedef value_type & | reference |
typedef value_type const & | const_reference |
typedef shared_ptr< T > | class_type |
typedef pointer | resource_type |
typedef const_pointer | const_resource_type |
Public Member Functions | |
Construction | |
shared_ptr () | |
shared_ptr (T *p) | |
shared_ptr (class_type const &rhs) | |
template<typename T2> | |
shared_ptr (shared_ptr< T2 > const &rhs) | |
~shared_ptr () throw () | |
class_type & | operator= (class_type const &rhs) |
template<typename T2> | |
class_type & | operator= (shared_ptr< T2 > const &rhs) |
Operations | |
void | close () |
pointer | detach () |
void | swap (class_type &rhs) |
Accessors | |
const_pointer | operator-> () const |
pointer | operator-> () |
pointer | get () const |
const_reference | operator* () const |
reference | operator* () |
Attributes | |
long | count () const |
long | use_count () const |
Returns count(). |
shared_ptr | ( | T * | p | ) | [inline, explicit] |
p
will be deleted, and get() will return NULL
std::bad_alloc | If exception support is enabled, an instance of std::bad_alloc will be thrown if memory cannot be acquired to hold the sharing resource. In this case, the object represented by p will be deleted |
References STLSOFT_ASSERT.
long use_count | ( | ) | const [inline] |