|
| unique_ptr (function_ref< void(T *)> &&deleter) noexcept |
| unique_ptr Creates an empty unique ptr that owns nothing. Can be passed ownership later via reset.
|
|
| unique_ptr (T *const ptr, function_ref< void(T *)> &&deleter) noexcept |
| unique_ptr Creates a unique pointer that takes ownership of an object. More...
|
|
| unique_ptr (const unique_ptr &other)=delete |
|
unique_ptr & | operator= (const unique_ptr &)=delete |
|
| unique_ptr (unique_ptr &&rhs) noexcept |
|
unique_ptr & | operator= (unique_ptr &&rhs) noexcept |
|
| ~unique_ptr () noexcept |
|
unique_ptr< T > & | operator= (std::nullptr_t) noexcept |
|
T * | operator-> () noexcept |
| operator -> Transparent access to the managed object. More...
|
|
const T * | operator-> () const noexcept |
| operator -> Transparent access to the managed object. More...
|
|
| operator bool () const noexcept |
| operator bool Returns true if it points to something.
|
|
T * | get () noexcept |
| get Retrieve the underlying raw pointer. More...
|
|
const T * | get () const noexcept |
| get Retrieve the underlying raw pointer. More...
|
|
T * | release () noexcept |
| release Release ownership of the underlying pointer. More...
|
|
void | reset (T *const ptr=nullptr) noexcept |
| reset Reset the unique pointer to take ownership of the given pointer. More...
|
|
void | swap (unique_ptr &other) noexcept |
| swap Swaps object ownership with another unique_ptr (incl. deleters) More...
|
|
template<typename T>
class iox::cxx::unique_ptr< T >
The unique_ptr class is a heap-less unique ptr implementation, unlike the STL.
To avoid using the heap, deleters are not managed by the pointer itself, and instead must be provided as function references ('cxx:function_ref'). The functions must exist at least as long as the pointers that use them.
Also unlike the STL implementation, the deleters are not encoded in the unique_ptr type, allowing unique_ptr instances with different deleters to be stored in the same containers.