DLPrimitives
|
a smart pointer similar to std::unique_ptr but it copies underlying object on pointer copy instead of moving its ownership. More...
#include <include/dlprim/json.hpp>
Public Member Functions | |
copy_ptr (T *v) | |
copy_ptr (copy_ptr const &other) | |
copy_ptr (copy_ptr &&other) | |
copy_ptr & | operator= (copy_ptr &&other) |
copy_ptr const & | operator= (copy_ptr const &other) |
T const * | get () const |
T * | get () |
T const & | operator* () const |
T & | operator* () |
T const * | operator-> () const |
T * | operator-> () |
T * | release () |
void | reset (T *p=0) |
void | swap (copy_ptr &other) |
a smart pointer similar to std::unique_ptr but it copies underlying object on pointer copy instead of moving its ownership.
Note: Underlying object has same constness as the pointer itself (not like in ordinary pointer).
Don't use it with polymorphic classes. Prefer clone_ptr instead.