mirror of https://github.com/axmolengine/axmol.git
add 'makeRef' for easier making a RefPtr (#17302)
This commit is contained in:
parent
9381152ef1
commit
ae60397472
|
@ -269,7 +269,13 @@ private:
|
||||||
// NOTE: We can ensure T is derived from cocos2d::Ref at compile time here.
|
// NOTE: We can ensure T is derived from cocos2d::Ref at compile time here.
|
||||||
static_assert(std::is_base_of<Ref, typename std::remove_const<T>::type>::value, "T must be derived from Ref");
|
static_assert(std::is_base_of<Ref, typename std::remove_const<T>::type>::value, "T must be derived from Ref");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class T> inline
|
||||||
|
RefPtr<T> makeRef(T *ptr)
|
||||||
|
{
|
||||||
|
return RefPtr<T>(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
template<class T> inline
|
template<class T> inline
|
||||||
bool operator<(const RefPtr<T>& r, std::nullptr_t)
|
bool operator<(const RefPtr<T>& r, std::nullptr_t)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue