This commit is contained in:
邹晓航
2015-03-16 15:14:13 +08:00
parent 88eab11155
commit 8e5f9a47af

View File

@@ -6,9 +6,24 @@
namespace TinySTL{
template<class T>
class cow_ptr{
public:
typedef T element_type;
public:
explicit cow_ptr(T *p = nullptr);
template<class D>
cow_ptr(T *p, D d);
cow_ptr(const cow_ptr& cp);
cow_ptr& operator = (const cow_ptr& cp);
element_type operator *()const;
element_type *operator ->()const;
private:
shared_ptr<T> ptr_;
shared_ptr<element_type> ptr_;
};
}
#include "Detail\COWPtr.impl.h"
#endif