diff --git a/src/entt/meta/internal.hpp b/src/entt/meta/internal.hpp index a31d6b1eb..ad8600ee3 100644 --- a/src/entt/meta/internal.hpp +++ b/src/entt/meta/internal.hpp @@ -260,7 +260,7 @@ struct meta_func_node { struct meta_type_node { using size_type = std::size_t; - const id_type type_hash; + const type_info info; id_type id; meta_type_node * next; meta_prop_node * prop; @@ -405,7 +405,7 @@ class ENTT_API meta_node { public: [[nodiscard]] static meta_type_node * resolve() ENTT_NOEXCEPT { static meta_type_node node{ - type_hash::value(), + type_id(), {}, nullptr, nullptr, diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 5726a2177..a2aaf5dba 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -12,6 +12,7 @@ #include "../config/config.h" #include "../core/fwd.hpp" #include "../core/utility.hpp" +#include "../core/type_info.hpp" #include "ctx.hpp" #include "internal.hpp" #include "range.hpp" @@ -342,9 +343,9 @@ public: template [[nodiscard]] const Type * try_cast() const { if(node) { - if(const auto type_hash = internal::meta_info::resolve()->type_hash; node->type_hash == type_hash) { + if(const auto info = internal::meta_info::resolve()->info; node->info == info) { return static_cast(storage.data()); - } else if(const auto *base = internal::find_if<&internal::meta_type_node::base>([type_hash](const auto *curr) { return curr->type()->type_hash == type_hash; }, node); base) { + } else if(const auto *base = internal::find_if<&internal::meta_type_node::base>([info](const auto *curr) { return curr->type()->info == info; }, node); base) { return static_cast(base->cast(storage.data())); } } @@ -394,9 +395,9 @@ public: template [[nodiscard]] meta_any convert() const { if(node) { - if(const auto type_hash = internal::meta_info::resolve()->type_hash; node->type_hash == type_hash) { + if(const auto info = internal::meta_info::resolve()->info; node->info == info) { return *this; - } else if(const auto * const conv = internal::find_if<&internal::meta_type_node::conv>([type_hash](const auto *curr) { return curr->type()->type_hash == type_hash; }, node); conv) { + } else if(const auto * const conv = internal::find_if<&internal::meta_type_node::conv>([info](const auto *curr) { return curr->type()->info == info; }, node); conv) { return conv->conv(storage.data()); } } @@ -411,7 +412,7 @@ public: */ template bool convert() { - bool valid = (node && node->type_hash == internal::meta_info::resolve()->type_hash); + bool valid = (node && node->info == internal::meta_info::resolve()->info); if(!valid) { if(auto any = std::as_const(*this).convert(); any) { @@ -487,7 +488,7 @@ public: * @return False if the two objects differ in their content, true otherwise. */ [[nodiscard]] bool operator==(const meta_any &other) const { - return (!node && !other.node) || (node && other.node && node->type_hash == other.node->type_hash && node->compare(storage.data(), other.storage.data())); + return (!node && !other.node) || (node && other.node && node->info == other.node->info && node->compare(storage.data(), other.storage.data())); } /** @@ -1009,9 +1010,9 @@ class meta_type { return std::find_if(range.begin(), range.end(), [](const auto &candidate) { return candidate.size == sizeof...(Args) && ([](auto *from, auto *to) { - return (from->type_hash == to->type_hash) - || internal::find_if<&node_type::base>([to](const auto *curr) { return curr->type()->type_hash == to->type_hash; }, from) - || internal::find_if<&node_type::conv>([to](const auto *curr) { return curr->type()->type_hash == to->type_hash; }, from); + return (from->info == to->info) + || internal::find_if<&node_type::base>([to](const auto *curr) { return curr->type()->info == to->info; }, from) + || internal::find_if<&node_type::conv>([to](const auto *curr) { return curr->type()->info == to->info; }, from); }(internal::meta_info::resolve(), candidate.arg(Indexes)) && ...); }).operator->(); } @@ -1028,11 +1029,11 @@ public: {} /** - * @brief Returns the type hash of the underlying type. - * @return The type hash of the underlying type. + * @brief Returns the type info object of the underlying type. + * @return The type info object of the underlying type. */ - [[nodiscard]] id_type hash() const ENTT_NOEXCEPT { - return node->type_hash; + [[nodiscard]] type_info info() const ENTT_NOEXCEPT { + return node->info; } /** @@ -1247,8 +1248,8 @@ public: */ template [[nodiscard]] meta_conv conv() const { - return internal::find_if<&node_type::conv>([type_hash = internal::meta_info::resolve()->type_hash](const auto *curr) { - return curr->type()->type_hash == type_hash; + return internal::find_if<&node_type::conv>([info = internal::meta_info::resolve()->info](const auto *curr) { + return curr->type()->info == info; }, node); } @@ -1461,7 +1462,7 @@ public: * otherwise. */ [[nodiscard]] bool operator==(const meta_type &other) const ENTT_NOEXCEPT { - return (!node && !other.node) || (node && other.node && node->type_hash == other.node->type_hash); + return (!node && !other.node) || (node && other.node && node->info == other.node->info); } /** diff --git a/src/entt/meta/resolve.hpp b/src/entt/meta/resolve.hpp index e4ac1a36c..7aa324541 100644 --- a/src/entt/meta/resolve.hpp +++ b/src/entt/meta/resolve.hpp @@ -3,6 +3,7 @@ #include +#include "../core/type_info.hpp" #include "ctx.hpp" #include "meta.hpp" #include "range.hpp" @@ -36,20 +37,21 @@ template * @param id Unique identifier. * @return The meta type associated with the given identifier, if any. */ -[[nodiscard]] inline meta_type resolve_id(const id_type id) ENTT_NOEXCEPT { +[[nodiscard]] inline meta_type resolve(const id_type id) ENTT_NOEXCEPT { internal::meta_range range{*internal::meta_context::global()}; return std::find_if(range.begin(), range.end(), [id](const auto &curr) { return curr.id == id; }).operator->(); } /** - * @brief Returns the meta type associated with a given type hash, if any. - * @param id Unique identifier. - * @return The meta type associated with the given type hash, if any. + * @brief Returns the meta type associated with a given type info object, if + * any. + * @param info The type info object of the requested type. + * @return The meta type associated with the given type info object, if any. */ -[[nodiscard]] inline meta_type resolve_type(const id_type id) ENTT_NOEXCEPT { +[[nodiscard]] inline meta_type resolve(const type_info info) ENTT_NOEXCEPT { internal::meta_range range{*internal::meta_context::global()}; - return std::find_if(range.begin(), range.end(), [id](const auto &curr) { return curr.type_hash == id; }).operator->(); + return std::find_if(range.begin(), range.end(), [info](const auto &curr) { return curr.info == info; }).operator->(); } diff --git a/test/entt/meta/meta_base.cpp b/test/entt/meta/meta_base.cpp index 97995c0a4..e8f98dcd3 100644 --- a/test/entt/meta/meta_base.cpp +++ b/test/entt/meta/meta_base.cpp @@ -19,7 +19,7 @@ TEST_F(MetaBase, Functionalities) { derived_t derived{}; ASSERT_TRUE(base); - ASSERT_EQ(base.parent(), entt::resolve_id("derived"_hs)); + ASSERT_EQ(base.parent(), entt::resolve("derived"_hs)); ASSERT_EQ(base.type(), entt::resolve()); ASSERT_EQ(base.cast(&derived), static_cast(&derived)); } diff --git a/test/entt/meta/meta_ctor.cpp b/test/entt/meta/meta_ctor.cpp index 4a7ae0eb9..c40087f26 100644 --- a/test/entt/meta/meta_ctor.cpp +++ b/test/entt/meta/meta_ctor.cpp @@ -46,7 +46,7 @@ TEST_F(MetaCtor, Functionalities) { auto ctor = entt::resolve().ctor(); ASSERT_TRUE(ctor); - ASSERT_EQ(ctor.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(ctor.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(ctor.size(), 2u); ASSERT_EQ(ctor.arg(0u), entt::resolve()); ASSERT_EQ(ctor.arg(1u), entt::resolve()); @@ -79,7 +79,7 @@ TEST_F(MetaCtor, Func) { auto ctor = entt::resolve().ctor(); ASSERT_TRUE(ctor); - ASSERT_EQ(ctor.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(ctor.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(ctor.size(), 1u); ASSERT_EQ(ctor.arg(0u), entt::resolve()); ASSERT_FALSE(ctor.arg(1u)); diff --git a/test/entt/meta/meta_data.cpp b/test/entt/meta/meta_data.cpp index 5c4acb2a4..79c87da2e 100644 --- a/test/entt/meta/meta_data.cpp +++ b/test/entt/meta/meta_data.cpp @@ -101,7 +101,7 @@ TEST_F(MetaData, Functionalities) { clazz_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "i"_hs); ASSERT_FALSE(data.is_const()); @@ -130,7 +130,7 @@ TEST_F(MetaData, Const) { clazz_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "j"_hs); ASSERT_TRUE(data.is_const()); @@ -158,7 +158,7 @@ TEST_F(MetaData, Static) { auto data = entt::resolve().data("h"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "h"_hs); ASSERT_FALSE(data.is_const()); @@ -186,7 +186,7 @@ TEST_F(MetaData, ConstStatic) { auto data = entt::resolve().data("k"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("clazz"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "k"_hs); ASSERT_TRUE(data.is_const()); @@ -259,7 +259,7 @@ TEST_F(MetaData, SetterGetterAsFreeFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "x"_hs); ASSERT_FALSE(data.is_const()); @@ -274,7 +274,7 @@ TEST_F(MetaData, SetterGetterAsMemberFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "y"_hs); ASSERT_FALSE(data.is_const()); @@ -289,7 +289,7 @@ TEST_F(MetaData, SetterGetterWithRefAsMemberFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "w"_hs); ASSERT_FALSE(data.is_const()); @@ -304,7 +304,7 @@ TEST_F(MetaData, SetterGetterMixed) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "z"_hs); ASSERT_FALSE(data.is_const()); @@ -319,7 +319,7 @@ TEST_F(MetaData, SetterGetterReadOnly) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "z_ro"_hs); ASSERT_TRUE(data.is_const()); @@ -334,7 +334,7 @@ TEST_F(MetaData, SetterGetterReadOnlyDataMember) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("setter_getter"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "value"_hs); ASSERT_TRUE(data.is_const()); @@ -348,7 +348,7 @@ TEST_F(MetaData, ArrayStatic) { auto data = entt::resolve().data("global"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("array"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("array"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "global"_hs); ASSERT_FALSE(data.is_const()); @@ -363,7 +363,7 @@ TEST_F(MetaData, Array) { array_t instance; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve_id("array"_hs)); + ASSERT_EQ(data.parent(), entt::resolve("array"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "local"_hs); ASSERT_FALSE(data.is_const()); diff --git a/test/entt/meta/meta_func.cpp b/test/entt/meta/meta_func.cpp index 8925f7031..105e1c893 100644 --- a/test/entt/meta/meta_func.cpp +++ b/test/entt/meta/meta_func.cpp @@ -85,7 +85,7 @@ TEST_F(MetaFunc, Functionalities) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve_id("func"_hs)); + ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "f2"_hs); ASSERT_EQ(func.size(), 2u); ASSERT_FALSE(func.is_const()); @@ -124,7 +124,7 @@ TEST_F(MetaFunc, Const) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve_id("func"_hs)); + ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "f1"_hs); ASSERT_EQ(func.size(), 1u); ASSERT_TRUE(func.is_const()); @@ -161,7 +161,7 @@ TEST_F(MetaFunc, RetVoid) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve_id("func"_hs)); + ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "g"_hs); ASSERT_EQ(func.size(), 1u); ASSERT_FALSE(func.is_const()); @@ -196,7 +196,7 @@ TEST_F(MetaFunc, Static) { func_t::value = 2; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve_id("func"_hs)); + ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "h"_hs); ASSERT_EQ(func.size(), 1u); ASSERT_FALSE(func.is_const()); @@ -232,7 +232,7 @@ TEST_F(MetaFunc, StaticRetVoid) { auto func = entt::resolve().func("k"_hs); ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve_id("func"_hs)); + ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "k"_hs); ASSERT_EQ(func.size(), 1u); ASSERT_FALSE(func.is_const()); diff --git a/test/entt/meta/meta_range.cpp b/test/entt/meta/meta_range.cpp index 9942152e7..3b2103e4a 100644 --- a/test/entt/meta/meta_range.cpp +++ b/test/entt/meta/meta_range.cpp @@ -20,9 +20,9 @@ TEST_F(MetaRange, Range) { ASSERT_TRUE(it != range.end()); ASSERT_FALSE(it == range.end()); - ASSERT_EQ((*it).hash(), entt::resolve().hash()); - ASSERT_EQ((*(++it)).hash(), entt::resolve_id("int"_hs).hash()); - ASSERT_EQ((*it++).hash(), entt::resolve().hash()); + ASSERT_EQ((*it).info(), entt::resolve().info()); + ASSERT_EQ((*(++it)).info(), entt::resolve("int"_hs).info()); + ASSERT_EQ((*it++).info(), entt::resolve().info()); ASSERT_EQ(it, range.end()); } diff --git a/test/entt/meta/meta_type.cpp b/test/entt/meta/meta_type.cpp index 533535639..d8e48f411 100644 --- a/test/entt/meta/meta_type.cpp +++ b/test/entt/meta/meta_type.cpp @@ -93,8 +93,8 @@ struct MetaType: ::testing::Test { }; TEST_F(MetaType, Resolve) { - ASSERT_EQ(entt::resolve(), entt::resolve_id("double"_hs)); - ASSERT_EQ(entt::resolve(), entt::resolve_type(entt::type_hash::value())); + ASSERT_EQ(entt::resolve(), entt::resolve("double"_hs)); + ASSERT_EQ(entt::resolve(), entt::resolve(entt::type_id())); auto range = entt::resolve(); // it could be "char"_hs rather than entt::hashed_string::value("char") if it weren't for a bug in VS2017 @@ -118,7 +118,7 @@ TEST_F(MetaType, Functionalities) { ASSERT_TRUE(type); ASSERT_NE(type, entt::meta_type{}); ASSERT_EQ(type.id(), "clazz"_hs); - ASSERT_EQ(type.hash(), entt::type_hash::value()); + ASSERT_EQ(type.info(), entt::type_id()); for(auto curr: type.prop()) { ASSERT_EQ(curr.key(), property_t::value); @@ -337,25 +337,25 @@ TEST_F(MetaType, ConstructCastAndConvert) { } TEST_F(MetaType, Reset) { - ASSERT_TRUE(entt::resolve_id("clazz"_hs)); + ASSERT_TRUE(entt::resolve("clazz"_hs)); - entt::resolve_id("clazz"_hs).reset(); + entt::resolve("clazz"_hs).reset(); - ASSERT_FALSE(entt::resolve_id("clazz"_hs)); + ASSERT_FALSE(entt::resolve("clazz"_hs)); ASSERT_NE(entt::resolve().id(), "clazz"_hs); ASSERT_FALSE(entt::resolve().prop(property_t::value)); ASSERT_FALSE(entt::resolve().data("value"_hs)); entt::meta().type("clazz"_hs); - ASSERT_TRUE(entt::resolve_id("clazz"_hs)); + ASSERT_TRUE(entt::resolve("clazz"_hs)); } TEST_F(MetaType, AbstractClass) { auto type = entt::resolve(); concrete_t instance; - ASSERT_EQ(type.hash(), entt::type_hash::value()); + ASSERT_EQ(type.info(), entt::type_id()); ASSERT_EQ(instance.base_t::value, 'c'); ASSERT_EQ(instance.value, 3); @@ -399,7 +399,7 @@ TEST_F(MetaType, ArithmeticTypeAndNamedConstants) { TEST_F(MetaType, Variables) { auto p_data = entt::resolve().data("var"_hs); - auto d_data = entt::resolve_id("double"_hs).data("var"_hs); + auto d_data = entt::resolve("double"_hs).data("var"_hs); property_t prop{property_t::key_only}; double d = 3.; @@ -445,10 +445,10 @@ TEST_F(MetaType, ResetAndReRegistrationAfterReset) { entt::resolve().reset(); entt::resolve().reset(); - ASSERT_FALSE(entt::resolve_id("double"_hs)); - ASSERT_FALSE(entt::resolve_id("base"_hs)); - ASSERT_FALSE(entt::resolve_id("derived"_hs)); - ASSERT_FALSE(entt::resolve_id("clazz"_hs)); + ASSERT_FALSE(entt::resolve("double"_hs)); + ASSERT_FALSE(entt::resolve("base"_hs)); + ASSERT_FALSE(entt::resolve("derived"_hs)); + ASSERT_FALSE(entt::resolve("clazz"_hs)); ASSERT_EQ(*entt::internal::meta_context::global(), nullptr); @@ -464,8 +464,8 @@ TEST_F(MetaType, ResetAndReRegistrationAfterReset) { ASSERT_FALSE(any.convert()); ASSERT_TRUE(any.convert()); - ASSERT_FALSE(entt::resolve_id("derived"_hs)); - ASSERT_TRUE(entt::resolve_id("double"_hs)); + ASSERT_FALSE(entt::resolve("derived"_hs)); + ASSERT_TRUE(entt::resolve("double"_hs)); entt::meta().data("rand"_hs).prop(property_t::value, 42).prop(property_t::random, 3); diff --git a/test/lib/meta/main.cpp b/test/lib/meta/main.cpp index 11769236d..2b4c3dfde 100644 --- a/test/lib/meta/main.cpp +++ b/test/lib/meta/main.cpp @@ -10,20 +10,20 @@ ENTT_API void tear_down(); ENTT_API entt::meta_any wrap_int(int); TEST(Lib, Meta) { - ASSERT_FALSE(entt::resolve_id("position"_hs)); - ASSERT_FALSE(entt::resolve_id("velocity"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); + ASSERT_FALSE(entt::resolve("velocity"_hs)); set_up(); entt::meta().conv(); - ASSERT_TRUE(entt::resolve_id("position"_hs)); - ASSERT_TRUE(entt::resolve_id("velocity"_hs)); + ASSERT_TRUE(entt::resolve("position"_hs)); + ASSERT_TRUE(entt::resolve("velocity"_hs)); - ASSERT_EQ(entt::resolve(), entt::resolve_id("position"_hs)); - ASSERT_EQ(entt::resolve(), entt::resolve_id("velocity"_hs)); + ASSERT_EQ(entt::resolve(), entt::resolve("position"_hs)); + ASSERT_EQ(entt::resolve(), entt::resolve("velocity"_hs)); - auto pos = entt::resolve_id("position"_hs).construct(42., 3.); - auto vel = entt::resolve_id("velocity"_hs).ctor<>().invoke(); + auto pos = entt::resolve("position"_hs).construct(42., 3.); + auto vel = entt::resolve("velocity"_hs).ctor<>().invoke(); ASSERT_TRUE(pos && vel); @@ -42,6 +42,6 @@ TEST(Lib, Meta) { tear_down(); - ASSERT_FALSE(entt::resolve_id("position"_hs)); - ASSERT_FALSE(entt::resolve_id("velocity"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); + ASSERT_FALSE(entt::resolve("velocity"_hs)); } diff --git a/test/lib/meta_plugin/main.cpp b/test/lib/meta_plugin/main.cpp index 1bc610c5d..18eee633e 100644 --- a/test/lib/meta_plugin/main.cpp +++ b/test/lib/meta_plugin/main.cpp @@ -8,7 +8,7 @@ #include "types.h" TEST(Lib, Meta) { - ASSERT_FALSE(entt::resolve_id("position"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); userdata ud{}; @@ -20,11 +20,11 @@ TEST(Lib, Meta) { entt::meta().conv(); - ASSERT_TRUE(entt::resolve_id("position"_hs)); - ASSERT_TRUE(entt::resolve_id("velocity"_hs)); + ASSERT_TRUE(entt::resolve("position"_hs)); + ASSERT_TRUE(entt::resolve("velocity"_hs)); - auto pos = entt::resolve_id("position"_hs).construct(42., 3.); - auto vel = entt::resolve_id("velocity"_hs).ctor<>().invoke(); + auto pos = entt::resolve("position"_hs).construct(42., 3.); + auto vel = entt::resolve("velocity"_hs).ctor<>().invoke(); ASSERT_TRUE(pos && vel); @@ -48,6 +48,6 @@ TEST(Lib, Meta) { cr_plugin_close(ctx); - ASSERT_FALSE(entt::resolve_id("position"_hs)); - ASSERT_FALSE(entt::resolve_id("velocity"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); + ASSERT_FALSE(entt::resolve("velocity"_hs)); } diff --git a/test/lib/meta_plugin_std/main.cpp b/test/lib/meta_plugin_std/main.cpp index 1bc610c5d..18eee633e 100644 --- a/test/lib/meta_plugin_std/main.cpp +++ b/test/lib/meta_plugin_std/main.cpp @@ -8,7 +8,7 @@ #include "types.h" TEST(Lib, Meta) { - ASSERT_FALSE(entt::resolve_id("position"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); userdata ud{}; @@ -20,11 +20,11 @@ TEST(Lib, Meta) { entt::meta().conv(); - ASSERT_TRUE(entt::resolve_id("position"_hs)); - ASSERT_TRUE(entt::resolve_id("velocity"_hs)); + ASSERT_TRUE(entt::resolve("position"_hs)); + ASSERT_TRUE(entt::resolve("velocity"_hs)); - auto pos = entt::resolve_id("position"_hs).construct(42., 3.); - auto vel = entt::resolve_id("velocity"_hs).ctor<>().invoke(); + auto pos = entt::resolve("position"_hs).construct(42., 3.); + auto vel = entt::resolve("velocity"_hs).ctor<>().invoke(); ASSERT_TRUE(pos && vel); @@ -48,6 +48,6 @@ TEST(Lib, Meta) { cr_plugin_close(ctx); - ASSERT_FALSE(entt::resolve_id("position"_hs)); - ASSERT_FALSE(entt::resolve_id("velocity"_hs)); + ASSERT_FALSE(entt::resolve("position"_hs)); + ASSERT_FALSE(entt::resolve("velocity"_hs)); }