make macros require a trailing semicolon

This commit is contained in:
Michele Caini
2019-10-21 14:23:22 +02:00
parent df13d993f7
commit 39e3a5a708
8 changed files with 17 additions and 16 deletions

2
TODO
View File

@@ -34,5 +34,5 @@
* use [[nodiscard]] consistently for safety purposes
* static reflection, hint: template<> meta_type_t<Type>: meta_descriptor<name, func..., props..., etc...>
* null support for entt::component
* make macros require a trailing ;
* named_type_traits<Type>::value -> named_type_traits_v<Type>
* extend to_integer to &, |, and so on...

View File

@@ -224,7 +224,8 @@ constexpr auto is_named_type_v = is_named_type<Type>::value;
enum class clazz: type {};\
constexpr auto to_integer(const clazz id) ENTT_NOEXCEPT {\
return std::underlying_type_t<clazz>(id);\
}
}\
static_assert(true)
}
@@ -264,7 +265,7 @@ constexpr auto is_named_type_v = is_named_type<Type>::value;
{\
static_assert(std::is_same_v<std::remove_cv_t<type>, type>);\
static_assert(std::is_object_v<type>);\
};
}
/**

View File

@@ -45,10 +45,10 @@ template<typename>
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<entity>;

View File

@@ -2,8 +2,8 @@
#include <entt/core/type_traits.hpp>
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<0>, entt::choice_t<1>>));

View File

@@ -9,7 +9,7 @@
#include <entt/entity/registry.hpp>
#include <entt/entity/entity.hpp>
ENTT_NAMED_TYPE(int)
ENTT_NAMED_TYPE(int);
struct empty_type {};

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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);