add 'makeRef' for easier making a RefPtr (#17302)

This commit is contained in:
Jeff Wang 2017-02-08 10:00:08 +08:00 committed by minggo
parent 9381152ef1
commit ae60397472
1 changed files with 7 additions and 1 deletions

View File

@ -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)
{