From 7fe8c80141b3bc843af704810f0c821d83792c0f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 26 Jun 2020 17:17:06 +0200 Subject: [PATCH] Fixed issue where the dereferencing function broke compilation on some compilers. --- src/Memory/BorrowedPtr.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/BorrowedPtr.hpp index 86ed90f..e931089 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/BorrowedPtr.hpp @@ -30,8 +30,13 @@ namespace ArbUt { return _raw; } inline T operator*() const { - AssertNotNull(_raw); - return *_raw; + 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 T* GetRaw() const noexcept { return _raw; }