|
|
@@ -424,8 +424,7 @@ public:
|
|
|
*/
|
|
|
template<typename Type>
|
|
|
[[nodiscard]] const Type *try_cast() const {
|
|
|
- const auto &other = type_id<std::remove_cv_t<Type>>();
|
|
|
- return static_cast<const Type *>(internal::try_cast(internal::meta_context::from(*ctx), node, other, storage.data()));
|
|
|
+ return static_cast<const Type *>(internal::try_cast(internal::meta_context::from(*ctx), node, type_id<std::remove_cv_t<Type>>(), storage.data()));
|
|
|
}
|
|
|
|
|
|
/*! @copydoc try_cast */
|
|
|
@@ -434,9 +433,8 @@ public:
|
|
|
if constexpr(std::is_const_v<Type>) {
|
|
|
return std::as_const(*this).try_cast<std::remove_const_t<Type>>();
|
|
|
} else {
|
|
|
- const auto &other = type_id<Type>();
|
|
|
// NOLINTNEXTLINE(bugprone-casting-through-void)
|
|
|
- return static_cast<Type *>(const_cast<void *>(internal::try_cast(internal::meta_context::from(*ctx), node, other, storage.data())));
|
|
|
+ return static_cast<Type *>(const_cast<void *>(internal::try_cast(internal::meta_context::from(*ctx), node, type_id<Type>(), storage.data())));
|
|
|
}
|
|
|
}
|
|
|
|