diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/BorrowedPtr.hpp index c29d677..bfca5b7 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/BorrowedPtr.hpp @@ -29,13 +29,10 @@ namespace ArbUt { AssertNotNull(_raw); return _raw; } - inline T operator*() const { - if constexpr (std::is_abstract()) { - static_assert(!std::is_abstract(), "You're not allowed to dereference an abstract class."); - } else { - AssertNotNull(_raw); - return *_raw; - } + + inline typename std::enable_if::value, bool>::type operator*() const { + AssertNotNull(_raw); + return *_raw; } inline T* GetRaw() const noexcept { return _raw; }