std::unique_ptr#include <zorba/internal/unique_ptr.h> Private Types
Public Types
Private Attributes
Public Functions
Private Functions
Private Typesdeleter_const_referenceZORBA_TR1_NS::add_reference< D const >::type deleter_const_reference
deleter_referenceZORBA_TR1_NS::add_reference< D >::type deleter_reference
Public Typesdeleter_typeD deleter_type
element_typeT element_type
pointerT * pointer
Private AttributesPublic Functionsget_deleterdeleter_reference get_deleter() Gets the deleter in use.
ReturnsReturns said deleter.get_deleterdeleter_const_reference get_deleter() const Gets the deleter in use.
ReturnsReturns said deleter.operator explicit_bool::type operator explicit_bool::type() const Conversion to bool.
ReturnsReturns true only if the pointer is not null; false only if the pointer is null.operator*element_type & operator*() const Dereferences the pointer.
ReturnsReturns a reference to the pointed-to object.operator::zorba::internal::rv operator::zorba::internal::rv()
operator::zorba::internal::rv operator::zorba::internal::rv() const
operator=unique_ptr & operator=(zorba::internal::rv< unique_ptr > &p) Destructive assignment: moves ownership of the object pointed-to by p to this unique_ptr. The object pointed-to by this unique_ptr, if any, is deleted. Parameters
ReturnsReturns *this.operator=unique_ptr & operator=(zorba::internal::rv< unique_ptr< U, E > > &p) Destructive assignment: moves ownership of the object pointed-to by p to this unique_ptr. The object pointed-to by this unique_ptr, if any, is deleted. Parameters
Parameters
ReturnsReturns *this.releasepointer release() Releases ownership of the pointed-to object. Said object will now be the responsibility of the caller. ReturnsReturns a pointer to the object.resetvoid reset(pointer p=nullptr) Sets the pointer to the given value or null if none. The previosly pointed-to object, if any, is deleted. However, if p equals the current pointer value, then this function does nothing. Parameters
swapvoid swap(unique_ptr &p) Swaps the pointer and deleter with that of another unique_ptr.
Parameters
unique_ptr unique_ptr(pointer p=nullptr) Default constructor.
Parameters
unique_ptr unique_ptr(pointer p, deleter_reference d) Constructs a unique_ptr using a specific deleter. This unique_ptr now has ownership of the pointed-to object. Parameters
unique_ptr unique_ptr(zorba::internal::rv< unique_ptr > &p) Constructs a unique_ptr from an existing unique_ptr. Note that: unique_ptr<int> a( new int(1) ); unique_ptr<int> b( a ); // compile-time errorInstead, you must use the function: unique_ptr<int> a( new int(1) ); unique_ptr<int> b( move(a) ); // ok now Parameters
unique_ptr unique_ptr(zorba::internal::rv< unique_ptr< U, E > > &p, typename enable_if< ZORBA_TR1_NS::is_convertible< typename unique_ptr< U >::pointer, pointer >::value &&ZORBA_TR1_NS::is_convertible< E, D >::value &&(!ZORBA_TR1_NS::is_reference< D >::value||ZORBA_TR1_NS::is_same< D, E >::value) >::type *=nullptr) Constructs a unique_ptr from an existing unique_ptr.
Parameters
Parameters
~unique_ptr ~unique_ptr() Destroys the pointed-to object by calling the deleter (if the pointer is not null).
Private Functionscall_deletervoid call_deleter()
unique_ptr unique_ptr(unique_ptr &)
unique_ptr unique_ptr(unique_ptr< U, E > &)
|