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; }