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
|
@ -270,6 +270,12 @@ private:
|
|||
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
|
||||
bool operator<(const RefPtr<T>& r, std::nullptr_t)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue