DLPrimitives
Public Member Functions | List of all members
dlprim::json::copy_ptr< T > Class Template Reference

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_ptroperator= (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)
 

Detailed Description

template<typename T>
class dlprim::json::copy_ptr< T >

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.


The documentation for this class was generated from the following file: