18#ifndef IOX_HOOFS_CXX_UNIQUE_PTR_HPP
19#define IOX_HOOFS_CXX_UNIQUE_PTR_HPP
21#include "iceoryx_hoofs/cxx/function_ref.hpp"
67 unique_ptr<T>& operator=(std::nullptr_t) noexcept;
73 T* operator->() noexcept;
79 const T* operator->() const noexcept;
84 explicit operator
bool() const noexcept;
98 const T*
get() const noexcept;
111 void reset(T* const ptr =
nullptr) noexcept;
127#include "iceoryx_hoofs/internal/cxx/unique_ptr.inl"
Definition: function_ref.hpp:34
The unique_ptr class is a heap-less unique ptr implementation, unlike the STL.
Definition: unique_ptr.hpp:37
unique_ptr(T *const ptr, function_ref< void(T *)> &&deleter) noexcept
unique_ptr Creates a unique pointer that takes ownership of an object.
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.
T * get() noexcept
get Retrieve the underlying raw pointer.
void swap(unique_ptr &other) noexcept
swap Swaps object ownership with another unique_ptr (incl. deleters)
void reset(T *const ptr=nullptr) noexcept
reset Reset the unique pointer to take ownership of the given pointer.
T * release() noexcept
release Release ownership of the underlying pointer.
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:29