22#include <kiwano/base/RefObject.h>
23#include <kiwano/core/RefBasePtr.hpp>
47template <
typename _Ty>
52template <
typename _Ty,
typename... _Args>
55 static_assert(std::is_base_of<RefObject, _Ty>::value,
"_Ty must be derived from RefObject");
56 return RefPtr<_Ty>(
new _Ty(std::forward<_Args>(args)...));
61template <
typename _Ty>
62inline RefPtr<_Ty> MakePtr(_Ty* ptr)
64 static_assert(std::is_base_of<RefObject, _Ty>::value,
"_Ty must be derived from RefObject");
65 return RefPtr<_Ty>(ptr);
引用计数智能指针
Definition: RefBasePtr.hpp:35
引用计数器
Definition: RefObject.h:33
void Retain()
增加引用计数
Definition: RefObject.cpp:33
void Release()
减少引用计数
Definition: RefObject.cpp:38
默认的智能指针引用计数策略
Definition: RefPtr.h:31