|
|
@@ -422,7 +422,7 @@ public:
|
|
|
template<typename Type>
|
|
|
[[nodiscard]] const Type *try_cast() const {
|
|
|
const auto *elem = any_cast<const Type>(&storage);
|
|
|
- return ((elem != nullptr) || (resolve == nullptr)) ? elem : static_cast<const Type *>(internal::try_cast(internal::meta_context::from(*ctx), fetch_node(), type_hash<std::remove_const_t<Type>>::value(), storage.data()));
|
|
|
+ return ((elem != nullptr) || (vtable == nullptr)) ? elem : static_cast<const Type *>(internal::try_cast(internal::meta_context::from(*ctx), fetch_node(), type_hash<std::remove_const_t<Type>>::value(), storage.data()));
|
|
|
}
|
|
|
|
|
|
/*! @copydoc try_cast */
|
|
|
@@ -433,7 +433,7 @@ public:
|
|
|
} else {
|
|
|
auto *elem = any_cast<Type>(&storage);
|
|
|
// NOLINTNEXTLINE(bugprone-casting-through-void)
|
|
|
- return ((elem != nullptr) || (resolve == nullptr)) ? elem : static_cast<Type *>(const_cast<void *>(internal::try_cast(internal::meta_context::from(*ctx), fetch_node(), type_hash<Type>::value(), storage.data())));
|
|
|
+ return ((elem != nullptr) || (vtable == nullptr)) ? elem : static_cast<Type *>(const_cast<void *>(internal::try_cast(internal::meta_context::from(*ctx), fetch_node(), type_hash<Type>::value(), storage.data())));
|
|
|
}
|
|
|
}
|
|
|
|