Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::locale::hold_ptr< T > Class Template Reference

a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer). More...

#include <hold_ptr.hpp>

Inheritance diagram for boost::locale::hold_ptr< T >:

Public Member Functions

 hold_ptr ()
 Create new empty pointer. More...
 
 hold_ptr (T *v)
 Create a pointer that holds v, ownership is transferred to smart pointer. More...
 
 ~hold_ptr ()
 Destroy smart pointer and the object it owns. More...
 
T const * get () const
 Get a const pointer to the object. More...
 
Tget ()
 Get a mutable pointer to the object. More...
 
T const & operator* () const
 Get a const reference to the object. More...
 
Toperator* ()
 Get a mutable reference to the object. More...
 
T const * operator-> () const
 Get a const pointer to the object. More...
 
Toperator-> ()
 Get a mutable pointer to the object. More...
 
Trelease ()
 Transfer an ownership on the pointer to user. More...
 
void reset (T *p=0)
 Set new value to pointer, previous object is destroyed, ownership on new object is transferred. More...
 
void swap (hold_ptr &other)
 Swap two pointers. More...
 

Detailed Description

template<typename T>
class boost::locale::hold_ptr< T >

a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer).

Constructor & Destructor Documentation

template<typename T>
boost::locale::hold_ptr< T >::hold_ptr ( )
inline

Create new empty pointer.

template<typename T>
boost::locale::hold_ptr< T >::hold_ptr ( T v)
inlineexplicit

Create a pointer that holds v, ownership is transferred to smart pointer.

template<typename T>
boost::locale::hold_ptr< T >::~hold_ptr ( )
inline

Destroy smart pointer and the object it owns.

Member Function Documentation

template<typename T>
T const* boost::locale::hold_ptr< T >::get ( ) const
inline

Get a const pointer to the object.

template<typename T>
T* boost::locale::hold_ptr< T >::get ( )
inline

Get a mutable pointer to the object.

template<typename T>
T const& boost::locale::hold_ptr< T >::operator* ( ) const
inline

Get a const reference to the object.

template<typename T>
T& boost::locale::hold_ptr< T >::operator* ( )
inline

Get a mutable reference to the object.

template<typename T>
T const* boost::locale::hold_ptr< T >::operator-> ( ) const
inline

Get a const pointer to the object.

template<typename T>
T* boost::locale::hold_ptr< T >::operator-> ( )
inline

Get a mutable pointer to the object.

template<typename T>
T* boost::locale::hold_ptr< T >::release ( )
inline

Transfer an ownership on the pointer to user.

template<typename T>
void boost::locale::hold_ptr< T >::reset ( T p = 0)
inline

Set new value to pointer, previous object is destroyed, ownership on new object is transferred.

template<typename T>
void boost::locale::hold_ptr< T >::swap ( hold_ptr< T > &  other)
inline

Swap two pointers.


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