SmartPointer s using this policy replicate the pointed-to object every time they themselves are replicated. This policy is especially useful for transporting polymorphic objects. The policy assumes the presence of a clone() member function in the pointee class that returns a pointer to the cloned object.
SmartPtr implementation presented in "Modern C++ Design" by Andrei Alexandrescu
Protected Types | |
| enum | { OWNERSHIP_TRANSFER = false } |
Protected Member Functions | |
| template<typename U> | |
| DeepCopy (const DeepCopy< U > &) | |
| DeepCopy () | |
Static Protected Member Functions | |
| static Ptr | clone (const Ptr &obj) |
| static bool | release (const Ptr &) |
| static void | swap (DeepCopy &) |
|
|||||
|
|
|
|||||||||
|
|
|
||||||||||||||
|
|
|
||||||||||
|
|
|
||||||||||
|
|
|
||||||||||
|
|
1.4.3