From d3c9998afaed7651de474cbbd9a047d244dafd33 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 26 Jun 2020 17:31:52 +0200 Subject: [PATCH] Fixes for dereference operator. --- src/Memory/BorrowedPtr.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; }