Hopefully fixes issues with incomplete types in BorrowedPtrs.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-06-26 17:42:43 +02:00
parent d3c9998afa
commit 7da8a46c45
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 10 additions and 1 deletions

View File

@ -30,7 +30,16 @@ namespace ArbUt {
return _raw;
}
inline typename std::enable_if<!std::is_abstract<T>::value, bool>::type operator*() const {
template <typename TValue> struct is_complete_helper {
template <typename U> static auto test(U*) -> std::integral_constant<bool, sizeof(U) == sizeof(U)>;
static auto test(...) -> std::false_type;
using type = decltype(test((TValue*)0));
};
template <typename TValue> struct is_complete : is_complete_helper<TValue>::type {};
inline typename std::enable_if<is_complete<T>::value && !std::is_abstract<T>::value, bool>::type
operator*() const {
AssertNotNull(_raw);
return *_raw;
}