From 88eab11155fc29cc92458d9b1d578a520c44ee9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Mon, 16 Mar 2015 15:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0friend=20class=20=E5=85=B3?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/Memory.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TinySTL/Memory.h b/TinySTL/Memory.h index a259797..cf2da31 100644 --- a/TinySTL/Memory.h +++ b/TinySTL/Memory.h @@ -6,6 +6,10 @@ #include "Detail\Ref.h" namespace TinySTL{ + template + class cow_ptr; + + template struct default_delete{ void operator ()(T* ptr){ if(ptr) delete ptr; } @@ -150,6 +154,10 @@ namespace TinySTL{ } private: ref_t *ref_; + + public: + template + friend class cow_ptr; }; template bool operator == (const shared_ptr& lhs, const shared_ptr& rhs){