meta: iterable base types as instances of meta_type

This commit is contained in:
Michele Caini
2021-01-15 14:34:27 +01:00
parent 997dd433b3
commit 0ec755fccf
4 changed files with 53 additions and 15 deletions

View File

@@ -251,6 +251,22 @@ TEST_F(MetaType, RemoveExtent) {
ASSERT_EQ(entt::resolve<derived_t>().remove_extent(), entt::resolve<derived_t>());
}
TEST_F(MetaType, Base) {
using namespace entt::literals;
auto type = entt::resolve<derived_t>();
bool iterate = false;
for(auto curr: type.base()) {
ASSERT_EQ(curr, entt::resolve<base_t>());
iterate = true;
}
ASSERT_TRUE(iterate);
ASSERT_EQ(type.base("base"_hs), entt::resolve<base_t>());
ASSERT_FALSE(type.base("esabe"_hs));
}
TEST_F(MetaType, Ctor) {
auto type = entt::resolve<clazz_t>();
int counter{};