Fixes for dereference operator.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-06-26 17:31:52 +02:00
parent c08224ed26
commit d3c9998afa
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 4 additions and 7 deletions

View File

@ -29,13 +29,10 @@ namespace ArbUt {
AssertNotNull(_raw);
return _raw;
}
inline T operator*() const {
if constexpr (std::is_abstract<T>()) {
static_assert(!std::is_abstract<T>(), "You're not allowed to dereference an abstract class.");
} else {
AssertNotNull(_raw);
return *_raw;
}
inline typename std::enable_if<!std::is_abstract<T>::value, bool>::type operator*() const {
AssertNotNull(_raw);
return *_raw;
}
inline T* GetRaw() const noexcept { return _raw; }