#include #include #include #include #include template struct function_type; template struct function_type {}; template struct entt::meta_template_traits> { using class_type = meta_class_template_tag; using args_type = type_list; }; TEST(MetaTemplate, Invalid) { const auto type = entt::resolve(); ASSERT_FALSE(type.is_template_specialization()); ASSERT_EQ(type.template_arity(), 0u); ASSERT_EQ(type.template_type(), entt::meta_type{}); ASSERT_EQ(type.template_arg(0u), entt::meta_type{}); } TEST(MetaTemplate, Valid) { const auto type = entt::resolve>(); ASSERT_TRUE(type.is_template_specialization()); ASSERT_EQ(type.template_arity(), 2u); ASSERT_EQ(type.template_type(), entt::resolve>()); ASSERT_EQ(type.template_arg(0u), entt::resolve()); ASSERT_EQ(type.template_arg(1u), entt::resolve()); ASSERT_EQ(type.template_arg(2u), entt::meta_type{}); } TEST(MetaTemplate, CustomTraits) { const auto type = entt::resolve>(); ASSERT_TRUE(type.is_template_specialization()); ASSERT_EQ(type.template_arity(), 3u); ASSERT_EQ(type.template_type(), entt::resolve>()); ASSERT_EQ(type.template_arg(0u), entt::resolve()); ASSERT_EQ(type.template_arg(1u), entt::resolve()); ASSERT_EQ(type.template_arg(2u), entt::resolve()); ASSERT_EQ(type.template_arg(3u), entt::meta_type{}); }