(ObjectRef) Added static_assert (Improved error message)

Former-commit-id: 11217f66e37fd6552d811298f7dacce940f894a3
This commit is contained in:
Lynix 2015-01-29 11:46:11 +01:00
parent 7a73314ef5
commit e82eccecfd
1 changed files with 2 additions and 0 deletions

View File

@ -135,6 +135,8 @@ template<typename T>
template<typename U>
NzObjectRef<T>& NzObjectRef<T>::operator=(const NzObjectRef<U>& ref)
{
static_assert(std::is_convertible<U*, T*>::value, "U is not implicitly convertible to T");
Reset(ref.Get());
return *this;