|
#include <smart_ptr.hpp>
#include "../shape_test.h" void example_ref_count_policy_usage() { smart_ptr<Shape, copy_on_write_policy<ref_count_policy> > pShape1 = new Square("Blue"); smart_ptr<Shape, shared_ptr_policy<ref_count_policy> > pShape2 = new Circle("Red"); smart_ptr<Shape, copy_on_write_policy<ref_count_policy> > pShape3 = pShape2; //exchangeable policies smart_ptr<Shape, shared_ptr_policy<ref_count_policy> > pShape4 = pShape1; //exchangeable policies }
Definition at line 523 of file smart_ptr.hpp.
Public Member Functions | |
ref_count_policy () | |
template<class T1> | |
ref_count_policy (ref_count_policy &src, T1 &) | |
template<class T, class F, class LCK> | |
void | release (T &type, F clone_fct, LCK &lck_policy) |
template<class T1, class F1, class T2, class F2, class LCK> | |
void | assign (T1 &type1, F1 &clone_fct1, T2 type2, const F2 clone_fct2, ref_count_policy &src_policy, LCK &lck_policy) |
Protected Member Functions | |
template<class T> | |
bool | is_referenced (T &) const |
|
Definition at line 549 of file smart_ptr.hpp. |