Doxygen
Loading...
Searching...
No Matches
DeepCopyUniquePtr< T > Class Template Reference

Helper class add copy/assignment support to std::unique_ptr by making a deep copy Note that T may not be a polymorphic type. More...

+ Inheritance diagram for DeepCopyUniquePtr< T >:
+ Collaboration diagram for DeepCopyUniquePtr< T >:

Public Member Functions

 DeepCopyUniquePtr (const DeepCopyUniquePtr &other)
 
DeepCopyUniquePtroperator= (const DeepCopyUniquePtr &other)
 
 DeepCopyUniquePtr (DeepCopyUniquePtr &&other)
 
DeepCopyUniquePtroperator= (DeepCopyUniquePtr &&other)
 
 ~DeepCopyUniquePtr ()=default
 

Detailed Description

template<class T>
class DeepCopyUniquePtr< T >

Helper class add copy/assignment support to std::unique_ptr by making a deep copy Note that T may not be a polymorphic type.

Definition at line 59 of file definition.cpp.

Constructor & Destructor Documentation

◆ DeepCopyUniquePtr() [1/2]

template<class T >
DeepCopyUniquePtr< T >::DeepCopyUniquePtr ( const DeepCopyUniquePtr< T > & other)
inline

Definition at line 63 of file definition.cpp.

64 : std::unique_ptr<T>(other ? new T(*other) : nullptr)
65 {
66 }
Helper class add copy/assignment support to std::unique_ptr by making a deep copy Note that T may not...

References DeepCopyUniquePtr().

Referenced by DeepCopyUniquePtr(), DeepCopyUniquePtr(), operator=(), and operator=().

◆ DeepCopyUniquePtr() [2/2]

template<class T >
DeepCopyUniquePtr< T >::DeepCopyUniquePtr ( DeepCopyUniquePtr< T > && other)
inline

Definition at line 72 of file definition.cpp.

References DeepCopyUniquePtr().

◆ ~DeepCopyUniquePtr()

template<class T >
DeepCopyUniquePtr< T >::~DeepCopyUniquePtr ( )
default

Member Function Documentation

◆ operator=() [1/2]

template<class T >
DeepCopyUniquePtr & DeepCopyUniquePtr< T >::operator= ( const DeepCopyUniquePtr< T > & other)
inline

Definition at line 67 of file definition.cpp.

68 {
69 if (*this!=other) this->reset(other ? new T(*other) : nullptr);
70 return *this;
71 }

References DeepCopyUniquePtr().

◆ operator=() [2/2]

template<class T >
DeepCopyUniquePtr & DeepCopyUniquePtr< T >::operator= ( DeepCopyUniquePtr< T > && other)
inline

Definition at line 73 of file definition.cpp.

74 {
76 return *this;
77 }

References DeepCopyUniquePtr().


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