|
@@ -143,12 +143,6 @@ template<typename... Args>
|
|
|
return value();
|
|
return value();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-[[nodiscard]] inline meta_type_node *try_resolve(const type_info &info) noexcept {
|
|
|
|
|
- auto &&context = meta_context::from(locator<meta_ctx>::value_or());
|
|
|
|
|
- const auto it = context.value.find(info.hash());
|
|
|
|
|
- return it != context.value.end() ? &it->second : nullptr;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
[[nodiscard]] inline const void *try_cast(const meta_type_node &from, const meta_type_node &to, const void *instance) noexcept {
|
|
[[nodiscard]] inline const void *try_cast(const meta_type_node &from, const meta_type_node &to, const void *instance) noexcept {
|
|
|
if(from.info && to.info && *from.info == *to.info) {
|
|
if(from.info && to.info && *from.info == *to.info) {
|
|
|
return instance;
|
|
return instance;
|
|
@@ -165,6 +159,12 @@ template<typename... Args>
|
|
|
return nullptr;
|
|
return nullptr;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+[[nodiscard]] inline meta_type_node *try_resolve(const type_info &info) noexcept {
|
|
|
|
|
+ auto &&context = meta_context::from(locator<meta_ctx>::value_or());
|
|
|
|
|
+ const auto it = context.value.find(info.hash());
|
|
|
|
|
+ return it != context.value.end() ? &it->second : nullptr;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
template<typename Type>
|
|
template<typename Type>
|
|
|
[[nodiscard]] meta_type_node resolve() noexcept {
|
|
[[nodiscard]] meta_type_node resolve() noexcept {
|
|
|
static_assert(std::is_same_v<Type, std::remove_const_t<std::remove_reference_t<Type>>>, "Invalid type");
|
|
static_assert(std::is_same_v<Type, std::remove_const_t<std::remove_reference_t<Type>>>, "Invalid type");
|