sparrow 0.3.0
|
A value_ptr is a smart pointer that behaves like a value. More...
#include <memory.hpp>
Public Types | |
using | self_type = value_ptr<T> |
using | pointer = typename internal_pointer::pointer |
using | element_type = typename internal_pointer::element_type |
Public Member Functions | |
constexpr | value_ptr () noexcept=default |
constexpr | value_ptr (std::nullptr_t) noexcept |
value_ptr (T value) | |
value_ptr (T *value) | |
~value_ptr ()=default | |
value_ptr (const value_ptr &other) | |
value_ptr (value_ptr &&other) noexcept=default | |
value_ptr & | operator= (const value_ptr &other) |
value_ptr & | operator= (value_ptr &&other) noexcept=default |
value_ptr & | operator= (std::nullptr_t) noexcept |
void | reset () noexcept |
T * | get () noexcept |
const T * | get () const noexcept |
operator bool () const noexcept | |
bool | has_value () const noexcept |
T & | operator* () |
const T & | operator* () const |
T * | operator-> () |
const T * | operator-> () const |
A value_ptr is a smart pointer that behaves like a value.
It manages the lifetime of an object of type T which is not stored in the value_ptr
but a pointer, similar to unique_ptr
. When copied, it copies the managed object.
T | The type of the object managed by the value_ptr . |
Definition at line 36 of file memory.hpp.
using sparrow::value_ptr< T >::element_type = typename internal_pointer::element_type |
Definition at line 44 of file memory.hpp.
using sparrow::value_ptr< T >::pointer = typename internal_pointer::pointer |
Definition at line 43 of file memory.hpp.
using sparrow::value_ptr< T >::self_type = value_ptr<T> |
Definition at line 42 of file memory.hpp.
|
constexprdefaultnoexcept |
|
constexprnoexcept |
|
explicit |
|
explicit |
Definition at line 232 of file memory.hpp.
|
default |
sparrow::value_ptr< T >::value_ptr | ( | const value_ptr< T > & | other | ) |
|
defaultnoexcept |
|
nodiscardnoexcept |
Definition at line 284 of file memory.hpp.
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
explicitnoexcept |
|
nodiscard |
Definition at line 302 of file memory.hpp.
|
nodiscard |
Definition at line 309 of file memory.hpp.
|
nodiscard |
Definition at line 316 of file memory.hpp.
|
nodiscard |
Definition at line 323 of file memory.hpp.
value_ptr< T > & sparrow::value_ptr< T >::operator= | ( | const value_ptr< T > & | other | ) |
|
noexcept |
|
defaultnoexcept |
|
noexcept |
Definition at line 272 of file memory.hpp.