|
#include <smart_ptr.hpp>
#include "../shape_test.h" void example_copy_on_write_policy_usage() { smart_ptr<ShapeWithNoCloneLogic, copy_on_write_policy<> > pShapeWithNoCloneLogic1 = new CircleWithNoCloneLogic; smart_ptr<ShapeWithNoCloneLogic, copy_on_write_policy<> > pShapeWithNoCloneLogic2(pShapeWithNoCloneLogic1); cout << pShapeWithNoCloneLogic2->GetTypeName() << endl; smart_ptr<Shape, copy_on_write_policy<> > pShape1 = new Square("Blue"); smart_ptr<Shape, copy_on_write_policy<> > pShape2 = pShape1; cout << pShape2->GetShapeName() << endl; smart_ptr<Shape, copy_on_write_policy<ref_count_policy> > pShape3 = pShape1; smart_ptr<Shape, copy_on_write_policy<ref_link_policy> > pShape4 = pShape1; smart_ptr<Shape, copy_on_write_policy<ref_intrusive_policy> > pShape5 = pShape1; }
Definition at line 775 of file smart_ptr.hpp.
Public Member Functions | |
copy_on_write_policy () | |
template<class T1, class F1, class T2> | |
copy_on_write_policy (REFERENCE_POLICY &src, const T1 &type, const F1 &, const T2 &) | |
template<class T, class F> | |
T | get_non_constant_ptr (T &type, F clone_fct) |