diff --git a/TODO b/TODO index ee9567899..20eeb6526 100644 --- a/TODO +++ b/TODO @@ -34,5 +34,5 @@ * use [[nodiscard]] consistently for safety purposes * static reflection, hint: template<> meta_type_t: meta_descriptor * null support for entt::component -* make macros require a trailing ; * named_type_traits::value -> named_type_traits_v +* extend to_integer to &, |, and so on... diff --git a/src/entt/core/type_traits.hpp b/src/entt/core/type_traits.hpp index 61dc21687..78f65bc68 100644 --- a/src/entt/core/type_traits.hpp +++ b/src/entt/core/type_traits.hpp @@ -224,7 +224,8 @@ constexpr auto is_named_type_v = is_named_type::value; enum class clazz: type {};\ constexpr auto to_integer(const clazz id) ENTT_NOEXCEPT {\ return std::underlying_type_t(id);\ - } + }\ + static_assert(true) } @@ -264,7 +265,7 @@ constexpr auto is_named_type_v = is_named_type::value; {\ static_assert(std::is_same_v, type>);\ static_assert(std::is_object_v);\ - }; + } /** diff --git a/src/entt/entity/fwd.hpp b/src/entt/entity/fwd.hpp index bffd08358..8ad240f8c 100644 --- a/src/entt/entity/fwd.hpp +++ b/src/entt/entity/fwd.hpp @@ -45,10 +45,10 @@ template class basic_continuous_loader; /*! @brief Alias declaration for the most common use case. */ -ENTT_OPAQUE_TYPE(entity, ENTT_ID_TYPE) +ENTT_OPAQUE_TYPE(entity, ENTT_ID_TYPE); /*! @brief Alias declaration for the most common use case. */ -ENTT_OPAQUE_TYPE(component, ENTT_ID_TYPE) +ENTT_OPAQUE_TYPE(component, ENTT_ID_TYPE); /*! @brief Alias declaration for the most common use case. */ using registry = basic_registry; diff --git a/test/entt/core/type_traits.cpp b/test/entt/core/type_traits.cpp index 5336bd5ad..dcdf6fb0b 100644 --- a/test/entt/core/type_traits.cpp +++ b/test/entt/core/type_traits.cpp @@ -2,8 +2,8 @@ #include ENTT_NAMED_TYPE(int); -ENTT_NAMED_STRUCT(named_struct, {}) -ENTT_NAMED_CLASS(named_class, {}) +ENTT_NAMED_STRUCT(named_struct, {}); +ENTT_NAMED_CLASS(named_class, {}); TEST(Choice, Functionalities) { ASSERT_TRUE((std::is_base_of_v, entt::choice_t<1>>)); diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index 90b52a246..26ac5c6ba 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -9,7 +9,7 @@ #include #include -ENTT_NAMED_TYPE(int) +ENTT_NAMED_TYPE(int); struct empty_type {}; diff --git a/test/entt/signal/dispatcher.cpp b/test/entt/signal/dispatcher.cpp index e6b313a60..7815152f7 100644 --- a/test/entt/signal/dispatcher.cpp +++ b/test/entt/signal/dispatcher.cpp @@ -7,7 +7,7 @@ struct an_event {}; struct another_event {}; struct one_more_event {}; -ENTT_NAMED_TYPE(an_event) +ENTT_NAMED_TYPE(an_event); struct receiver { static void forward(entt::dispatcher &dispatcher, const an_event &event) { diff --git a/test/entt/signal/emitter.cpp b/test/entt/signal/emitter.cpp index c1fbc5a94..7c78e75d1 100644 --- a/test/entt/signal/emitter.cpp +++ b/test/entt/signal/emitter.cpp @@ -8,7 +8,7 @@ struct foo_event { int i; char c; }; struct bar_event {}; struct quux_event {}; -ENTT_NAMED_TYPE(foo_event) +ENTT_NAMED_TYPE(foo_event); TEST(Emitter, Clear) { test_emitter emitter; diff --git a/test/lib/types.h b/test/lib/types.h index f84be7eca..c5689324f 100644 --- a/test/lib/types.h +++ b/test/lib/types.h @@ -8,18 +8,18 @@ struct test_emitter ENTT_NAMED_STRUCT(position, { int x; int y; -}) +}); ENTT_NAMED_STRUCT(velocity, { int dx; int dy; -}) +}); ENTT_NAMED_STRUCT(an_event, { int payload; -}) +}); -ENTT_NAMED_STRUCT(another_event, {}) +ENTT_NAMED_STRUCT(another_event, {}); -ENTT_NAMED_TYPE(int) -ENTT_NAMED_TYPE(char) +ENTT_NAMED_TYPE(int); +ENTT_NAMED_TYPE(char);