kblib 0.2.3
General utilities library for modern C++
|
#include <kblib/memory.h>
Public Types | |
using | pointer = detail_memory::filter_deleter_pointer_t< Deleter, T > |
using | element_type = T |
using | deleter_type = Deleter |
using | unique = std::unique_ptr< T, Deleter > |
Public Member Functions | |
cond_ptr () noexcept=default | |
cond_ptr (std::nullptr_t) noexcept | |
cond_ptr (T *p, bool owner=false, std::decay_t< Deleter > del={}) noexcept | |
cond_ptr (T *p, std::decay_t< Deleter > del) noexcept | |
cond_ptr (unique &&p) noexcept | |
cond_ptr (const cond_ptr &other)=delete | |
cond_ptr (cond_ptr &&other) noexcept | |
auto | operator= (const cond_ptr &rhs) &-> cond_ptr &=delete |
auto | operator= (cond_ptr &&rhs) &noexcept -> cond_ptr & |
auto | operator= (unique &&rhs) -> cond_ptr & |
auto | to_unique () &&noexcept -> unique |
Transfers ownership to a unique_ptr if possible. If *this is not owning, returns nullptr. More... | |
operator unique () &&noexcept | |
~cond_ptr () noexcept | |
auto | weak () const &noexcept -> cond_ptr |
auto | owns () const noexcept -> bool |
auto | release () &noexcept -> T * |
auto | get_deleter () noexcept -> Deleter & |
auto | get_deleter () const noexcept -> const Deleter & |
auto | reset (T *p=nullptr, bool owner=false, std::decay_t< Deleter > del={}) &noexcept -> void |
auto | reset (T *p, std::decay_t< Deleter > del={}) &noexcept -> void |
auto | swap (cond_ptr &other) noexcept(fakestd::is_nothrow_swappable< Deleter >::value) -> void |
auto | get () &noexcept -> T * |
auto | get () const &noexcept -> const T * |
operator bool () const noexcept | |
auto | operator* () &noexcept -> T & |
auto | operator* () const &noexcept -> const T & |
auto | operator-> () &noexcept -> T * |
auto | operator-> () const &noexcept -> const T * |
Static Public Member Functions | |
static auto | adopt (T *p) noexcept -> cond_ptr |
static auto | adopt (T *p, deleter_type del) noexcept -> cond_ptr |
Friends | |
constexpr auto | operator== (const cond_ptr &lhs, const cond_ptr &rhs) noexcept -> bool |
constexpr auto | operator== (const unique &lhs, const cond_ptr &rhs) noexcept -> bool |
constexpr auto | operator== (const cond_ptr &lhs, const unique &rhs) noexcept -> bool |
using kblib::cond_ptr< T, Deleter >::deleter_type = Deleter |
using kblib::cond_ptr< T, Deleter >::element_type = T |
using kblib::cond_ptr< T, Deleter >::pointer = detail_memory::filter_deleter_pointer_t<Deleter, T> |
using kblib::cond_ptr< T, Deleter >::unique = std::unique_ptr<T, Deleter> |
|
defaultnoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
delete |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Transfers ownership to a unique_ptr if possible. If *this is not owning, returns nullptr.
|
inlinenoexcept |