提交 8e5f9a47 编写于 作者: 邹晓航

backup

上级 88eab111
...@@ -6,9 +6,24 @@ ...@@ -6,9 +6,24 @@
namespace TinySTL{ namespace TinySTL{
template<class T> template<class T>
class cow_ptr{ 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: private:
shared_ptr<T> ptr_; shared_ptr<element_type> ptr_;
}; };
} }
#include "Detail\COWPtr.impl.h"
#endif #endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册