From 7da8a46c45ffac9c2676215c730a4e4b78b11f55 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 26 Jun 2020 17:42:43 +0200 Subject: [PATCH] Hopefully fixes issues with incomplete types in BorrowedPtrs. --- src/Memory/BorrowedPtr.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/BorrowedPtr.hpp index bfca5b7..52a0e1b 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/BorrowedPtr.hpp @@ -30,7 +30,16 @@ namespace ArbUt { return _raw; } - inline typename std::enable_if::value, bool>::type operator*() const { + template struct is_complete_helper { + template static auto test(U*) -> std::integral_constant; + static auto test(...) -> std::false_type; + using type = decltype(test((TValue*)0)); + }; + + template struct is_complete : is_complete_helper::type {}; + + inline typename std::enable_if::value && !std::is_abstract::value, bool>::type + operator*() const { AssertNotNull(_raw); return *_raw; }