添加friend class 关系
This commit is contained in:
@@ -6,6 +6,10 @@
|
|||||||
#include "Detail\Ref.h"
|
#include "Detail\Ref.h"
|
||||||
|
|
||||||
namespace TinySTL{
|
namespace TinySTL{
|
||||||
|
template<class _T>
|
||||||
|
class cow_ptr;
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct default_delete{
|
struct default_delete{
|
||||||
void operator ()(T* ptr){ if(ptr) delete ptr; }
|
void operator ()(T* ptr){ if(ptr) delete ptr; }
|
||||||
@@ -150,6 +154,10 @@ namespace TinySTL{
|
|||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
ref_t<T> *ref_;
|
ref_t<T> *ref_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
template<class _T>
|
||||||
|
friend class cow_ptr;
|
||||||
};
|
};
|
||||||
template<class T1, class T2>
|
template<class T1, class T2>
|
||||||
bool operator == (const shared_ptr<T1>& lhs, const shared_ptr<T2>& rhs){
|
bool operator == (const shared_ptr<T1>& lhs, const shared_ptr<T2>& rhs){
|
||||||
|
|||||||
Reference in New Issue
Block a user