Lagrange
|
Smart pointer with value semantics. More...
#include <lagrange/utils/value_ptr.h>
Public Types | |
using | pointer = T * |
using | element_type = T |
using | cloner_type = Cloner |
using | deleter_type = Deleter |
Public Member Functions | |
value_ptr (const T &value) | |
value_ptr (T &&value) | |
value_ptr (const Cloner &value) | |
value_ptr (Cloner &&value) | |
template<typename V , typename ClonerOrDeleter > | |
value_ptr (V &&value, ClonerOrDeleter &&a2) | |
template<typename V , typename C , typename D > | |
value_ptr (V &&value, C &&cloner, D &&deleter) | |
value_ptr (value_ptr const &v) | |
value_ptr (value_ptr &&v)=default | |
value_ptr (pointer value) | |
pointer | release () |
T * | get () noexcept |
T const * | get () const noexcept |
Cloner & | get_cloner () noexcept |
Cloner const & | get_cloner () const noexcept |
Deleter & | get_deleter () noexcept |
Deleter const & | get_deleter () const noexcept |
T & | operator* () |
T const & | operator* () const |
T const * | operator-> () const noexcept |
T * | operator-> () noexcept |
value_ptr< T > & | operator= (value_ptr &&v) noexcept |
value_ptr< T > & | operator= (value_ptr const &v) |
operator bool () const noexcept | |
Smart pointer with value semantics.
Copy/moving the pointer will copy/move the underlying object. This is useful to implement PIMPL idioms.
T | Object type of the pointee. |
Cloner | Optional cloner functor. |
Deleter | Optional deleter functor. |