shared_ptr Class Template Reference

List of all members.

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 480 of file boost_shared_ptr.h.

Public Types

Public Member Functions

Friends


Constructor & Destructor Documentation

shared_ptr  )  [inline]
 

Construct an empty shared_ptr.

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

Definition at line 491 of file boost_shared_ptr.h.

Referenced by shared_ptr::operator=(), and shared_ptr::reset().

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 500 of file boost_shared_ptr.h.

References __glibcxx_function_requires.

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 522 of file boost_shared_ptr.h.

References __glibcxx_function_requires.

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 540 of file boost_shared_ptr.h.

References __glibcxx_function_requires.

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 554 of file boost_shared_ptr.h.

References __glibcxx_function_requires, and weak_ptr::_M_ptr.

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

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

Definition at line 567 of file boost_shared_ptr.h.

References auto_ptr::get().


The documentation for this class was generated from the following file:
Generated on Tue May 23 12:56:34 2006 for libstdc++ source by  doxygen 1.4.4