cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Public Member Functions | List of all members
unique_ptr< T, D > Class Template Reference

unique_ptr: a scoped, movable smart pointer. More...

Public Member Functions

 unique_ptr () CXXO_NOEXCEPTNOTHROW
 Creates from a rvalue-wrapper (from eg.: move ). More...
 
 unique_ptr (pointer p)
 Creates a unique_ptr wrapping the allocated pointer p .
 
cxxomfort::traits::add_reference< T >::type operator* () const
 Provide access to member.
 
pointer operator-> () const
 Provides access to member.
 
pointer get () const
 Provides access to member.
 
deleter_reference get_deleter ()
 Provides access to deleter.
 
void reset (pointer p=pointer())
 Resets / reassigns the unique_ptr to another allocated pointer.
 
 operator detail_unique_ptr::rv< unique_ptr > ()
 Converts unique_ptr to its rvalue-wrapper (for eg.: move ).
 
 unique_ptr (CXXO_RV_REF(unique_ptr) r)
 Creates from a rvalue-wrapper (from eg.: move ).
 
CXXO_CONSTEXPR unique_ptr () CXXO_NOEXCEPTNOTHROW
 Default constructor.
 
 unique_ptr (pointer p)
 Creates a unique_ptr wrapping the allocated pointer p .
 
 unique_ptr (pointer p, typename ::cxxomfort::traits::conditional< ::cxxomfort::traits::is_reference< D >::value, volatile typename std::remove_reference< D >::type &, D >::type d)
 Creates a unique_ptr given a pointer and a deleter, which is stored unreferenced.
 
template<class U , class E >
 unique_ptr (unique_ptr< U, E > u, typename std::enable_if< !std::is_array< U >::value &&detail_unique_ptr::is_convertible< typename unique_ptr< U >::pointer, pointer >::value &&detail_unique_ptr::is_convertible< E, deleter_type >::value &&(!std::is_reference< deleter_type >::value||std::is_same< deleter_type, E >::value), void >::type *=0)
 Creates a unique_ptr from a convertible pointer and deleter.
 
unique_ptroperator= (std::nullptr_t)
 reset a unique_ptr by assigning null pointer literal
 
template<class U , class E >
unique_ptroperator= (unique_ptr< U, E > u)
 Assignment (moves resource to this object).
 
std::add_reference< T >::type operator* () const
 Provide access to member.
 
pointer operator-> () const
 Provides access to member.
 
pointer get () const
 Provides access to member.
 
deleter_reference get_deleter ()
 Provides access to deleter.
 
void reset (pointer p=pointer())
 Resets / reassigns the unique_ptr to another allocated pointer.
 
pointer release ()
 Returns the owned pointer and releases its ownership.
 
void swap (unique_ptr &u)
 Swap.
 

Detailed Description

template<typename T, typename D = default_delete<T>>
class cxxomfort::cxxostd::unique_ptr< T, D >

unique_ptr: a scoped, movable smart pointer.

C++11 Backports:
Concept of a unique_ptr with ownership and transfer semantics.

Emulation of the unique_ptr implementation in C++11 for C++03 compilers. Original backport by Howard Hinnant.

Constructor & Destructor Documentation

◆ unique_ptr()

unique_ptr ( )
inline

Creates from a rvalue-wrapper (from eg.: move ).

Default constructor.


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