named_type_traits<Type>::value -> named_type_traits_v<Type>
This commit is contained in:
4
TODO
4
TODO
@@ -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
|
||||
* named_type_traits<Type>::value -> named_type_traits_v<Type>
|
||||
* extend to_integer to &, |, and so on...
|
||||
* add ENTT_CUSTOM_NAMED_TYPE for custom names
|
||||
* Make another attempt to overcome named types
|
||||
|
||||
@@ -192,6 +192,14 @@ template<typename Type>
|
||||
using named_type_traits_t = typename named_type_traits<Type>::type;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Helper variable template.
|
||||
* @tparam Type Potentially named type.
|
||||
*/
|
||||
template<class Type>
|
||||
constexpr auto named_type_traits_v = named_type_traits<Type>::value;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Provides the member constant `value` to true if a given type has a
|
||||
* name. In all other cases, `value` is false.
|
||||
|
||||
@@ -216,7 +216,7 @@ class basic_registry {
|
||||
template<typename Type, typename Family>
|
||||
static ENTT_ID_TYPE runtime_type() ENTT_NOEXCEPT {
|
||||
if constexpr(is_named_type_v<Type>) {
|
||||
return named_type_traits<Type>::value;
|
||||
return named_type_traits_v<Type>;
|
||||
} else {
|
||||
return Family::template type<Type>;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ struct meta_node<Type> {
|
||||
|
||||
if constexpr(is_named_type_v<Type>) {
|
||||
auto *candidate = internal::find_if([](auto *candidate) {
|
||||
return candidate->identifier == named_type_traits<Type>::value;
|
||||
return candidate->identifier == named_type_traits_v<Type>;
|
||||
}, *meta_node<>::global);
|
||||
|
||||
return candidate ? candidate : &node;
|
||||
|
||||
@@ -88,7 +88,7 @@ class dispatcher {
|
||||
template<typename Event>
|
||||
static auto type() ENTT_NOEXCEPT {
|
||||
if constexpr(is_named_type_v<Event>) {
|
||||
return named_type_traits<Event>::value;
|
||||
return named_type_traits_v<Event>;
|
||||
} else {
|
||||
return event_family::type<Event>;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class emitter {
|
||||
template<typename Event>
|
||||
static auto type() ENTT_NOEXCEPT {
|
||||
if constexpr(is_named_type_v<Event>) {
|
||||
return named_type_traits<Event>::value;
|
||||
return named_type_traits_v<Event>;
|
||||
} else {
|
||||
return handler_family::type<Event>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user