shared_ptr Class Template Reference

List of all members.

Public Types

Public Member Functions

Friends


Detailed Description

template<typename _Tp>
class std::tr1::shared_ptr< _Tp >

A smart pointer with reference-counted copy semantics. The object pointed to is deleted when the last shared_ptr pointing to it is destroyed or reset.

Definition at line 485 of file boost_shared_ptr.h.


Constructor & Destructor Documentation

shared_ptr (  )  [inline]

Construct an empty shared_ptr.

Postcondition:
use_count()==0 && get()==0

Definition at line 496 of file boost_shared_ptr.h.

shared_ptr ( _Tp1 *  __p  )  [inline, explicit]

Construct a shared_ptr that owns the pointer p.

Parameters:
p A pointer that is convertible to element_type*.
Postcondition:
use_count() == 1 && get() == p
Exceptions:
std::bad_alloc,in which case delete p is called.

Definition at line 506 of file boost_shared_ptr.h.

shared_ptr ( _Tp1 *  __p,
_Deleter  __d 
) [inline]

Construct a shared_ptr that owns the pointer p and the deleter d.

Parameters:
p A pointer.
d A deleter.
Postcondition:
use_count() == 1 && get() == p
Exceptions:
std::bad_alloc,in which case d(p) is called.

Definition at line 528 of file boost_shared_ptr.h.

shared_ptr ( const shared_ptr< _Tp1 > &  __r  )  [inline]

If r is empty, constructs an empty shared_ptr; otherwise construct a shared_ptr that shares ownership with r.

Parameters:
r A shared_ptr.
Postcondition:
get() == r.get() && use_count() == r.use_count()
Exceptions:
std::bad_alloc,in which case

Definition at line 546 of file boost_shared_ptr.h.

shared_ptr ( const weak_ptr< _Tp1 > &  __r  )  [inline, explicit]

Constructs a shared_ptr that shares ownership with r and stores a copy of the pointer stored in r.

Parameters:
r A weak_ptr.
Postcondition:
use_count() == r.use_count()
Exceptions:
bad_weak_ptr when r.expired(), in which case the constructor has no effect.

Definition at line 560 of file boost_shared_ptr.h.

shared_ptr ( std::auto_ptr< _Tp1 > &  __r  )  [inline, explicit]

Postcondition:
use_count() == 1 and r.get() == 0

Definition at line 573 of file boost_shared_ptr.h.

References auto_ptr::get().


The documentation for this class was generated from the following file:

Generated on Tue Dec 2 03:59:57 2008 for libstdc++ by  doxygen 1.5.7.1