Pointer to a unique, non-shared, object. Finalizer is run upon destruction (deletes object by default) if pointer is not null.
More...
|
| UniquePtr () |
|
| UniquePtr (nullptr_t) |
|
template<class Fin_ = Fin> |
| UniquePtr (Ptr ptr, Fin_ &&f=Fin_()) |
|
| UniquePtr (UniquePtr &&rhs) noexcept |
| Moves pointer and finalizer out of rhs. To set a new finalizer into rhs use move assign: rhs = UniquePtr(p,f);. More...
|
|
template<class U , class F > |
| UniquePtr (UniquePtr< U, F > &&rhs) |
|
| ~UniquePtr () |
|
UniquePtr & | operator= (UniquePtr &&rhs) |
| Moves pointer and finalizer out of rhs. More...
|
|
template<class U , class F > |
UniquePtr & | operator= (UniquePtr< U, F > &&rhs) |
|
template<class U , class F > |
bool | operator== (const UniquePtr< U, F > &rhs) const |
|
template<class U , class F > |
bool | operator!= (const UniquePtr< U, F > &rhs) const |
|
template<class U , class F > |
bool | operator< (const UniquePtr< U, F > &rhs) const |
|
template<class U , class F > |
bool | operator> (const UniquePtr< U, F > &rhs) const |
|
template<class U , class F > |
bool | operator<= (const UniquePtr< U, F > &rhs) const |
|
template<class U , class F > |
bool | operator>= (const UniquePtr< U, F > &rhs) const |
|
Ptr | operator-> () const |
|
Ref | operator* () const |
|
| operator Ptr () const |
|
Ptr | get () const |
| Get the raw pointer to the object. More...
|
|
Fin & | finalizer () |
| Get the finalizer. More...
|
|
const Fin & | finalizer () const |
|
Ptr | release () |
| Give up ownership of pointer without finalizing and set to null. More...
|
|
void | set (Ptr p) |
| Finalize old pointer and assign new. Does not finalize if old pointer is the same or null. More...
|
|
|
(Note that these are not member functions.)
|
template<class T , class Alloc , class... Args, class Fin = finalize<T,typename mt::removeRef<Alloc>::type>> |
UniquePtr< T, Fin > | alloc_unique (Alloc &&a, Args &&...args) |
| Create a unique ptr to an object of type T constructed with args. More...
|
|
template<class T , class... Args, typename mt::disable_if< std::is_array< T >::value, int >::type = 0, class Alloc = typename DefaultAllocator<T>::type> |
UniquePtr< T > | make_unique (Args &&...args) |
| alloc_unique() using T::Allocator if available, otherwise std::allocator More...
|
|
template<class T , class... Args, typename std::enable_if< std::is_array< T >::value, int >::type = 0> |
UniquePtr< T > | make_unique (szt size) |
| Create a unique ptr to an array of size number of elements. More...
|
|
template<class T , class... Args, typename std::enable_if< std::is_array< T >::value, int >::type = 0> |
UniquePtr< T > | make_unique_auto_size (Args &&...args) |
| Create a unique ptr to an array with deduced size. More...
|
|
template<class T, class Fin = finalize<T>>
class honey::UniquePtr< T, Fin >
Pointer to a unique, non-shared, object. Finalizer is run upon destruction (deletes object by default) if pointer is not null.