*: internal review of some traits usage
This commit is contained in:
1
TODO
1
TODO
@@ -12,7 +12,6 @@ DOC:
|
||||
* update entity doc when the storage based model is in place
|
||||
|
||||
TODO (high prio):
|
||||
* remove_const_t vs remove_cv_t
|
||||
* remove the static storage from the const assure in the registry
|
||||
|
||||
WIP:
|
||||
|
||||
@@ -131,7 +131,7 @@ class basic_any {
|
||||
static_assert(sizeof...(Args) == 1u && (std::is_lvalue_reference_v<Args> && ...), "Invalid arguments");
|
||||
mode = std::is_const_v<std::remove_reference_t<Type>> ? policy::cref : policy::ref;
|
||||
instance = (std::addressof(args), ...);
|
||||
} else if constexpr(in_situ<std::remove_const_t<std::remove_reference_t<Type>>>) {
|
||||
} else if constexpr(in_situ<std::remove_cv_t<std::remove_reference_t<Type>>>) {
|
||||
if constexpr(sizeof...(Args) != 0u && std::is_aggregate_v<std::remove_cv_t<std::remove_reference_t<Type>>>) {
|
||||
new(&storage) std::remove_cv_t<std::remove_reference_t<Type>>{std::forward<Args>(args)...};
|
||||
} else {
|
||||
|
||||
@@ -551,7 +551,7 @@ struct has_iterator_category<Type, std::void_t<typename std::iterator_traits<Typ
|
||||
|
||||
/*! @copydoc is_iterator */
|
||||
template<typename Type>
|
||||
struct is_iterator<Type, std::enable_if_t<!std::is_same_v<std::remove_const_t<std::remove_pointer_t<Type>>, void>>>
|
||||
struct is_iterator<Type, std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_pointer_t<Type>>, void>>>
|
||||
: internal::has_iterator_category<Type> {};
|
||||
|
||||
/**
|
||||
@@ -639,7 +639,7 @@ template<typename Type>
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] constexpr std::enable_if_t<is_complete_v<std::tuple_size<std::remove_const_t<Type>>>, bool> maybe_equality_comparable(choice_t<2>) {
|
||||
[[nodiscard]] constexpr std::enable_if_t<is_complete_v<std::tuple_size<std::remove_cv_t<Type>>>, bool> maybe_equality_comparable(choice_t<2>) {
|
||||
if constexpr(has_tuple_size_value<Type>::value) {
|
||||
return unpack_maybe_equality_comparable<Type>(std::make_index_sequence<std::tuple_size<Type>::value>{});
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,7 @@ template<typename It, typename... Owned, typename... Get>
|
||||
class extended_group_iterator<It, owned_t<Owned...>, get_t<Get...>> {
|
||||
template<typename Type>
|
||||
auto index_to_element(Type &cpool) const {
|
||||
if constexpr(ignore_as_empty_v<std::remove_const_t<typename Type::value_type>>) {
|
||||
if constexpr(ignore_as_empty_v<typename Type::value_type>) {
|
||||
return std::make_tuple();
|
||||
} else {
|
||||
return std::forward_as_tuple(cpool.rbegin()[it.index()]);
|
||||
|
||||
@@ -339,8 +339,8 @@ public:
|
||||
/* this is never static */
|
||||
std::is_const_v<data_type> ? internal::meta_traits::is_const : internal::meta_traits::is_none,
|
||||
1u,
|
||||
&internal::resolve<std::remove_const_t<data_type>>,
|
||||
&meta_arg<type_list<std::remove_const_t<data_type>>>,
|
||||
&internal::resolve<std::remove_cv_t<data_type>>,
|
||||
&meta_arg<type_list<std::remove_cv_t<data_type>>>,
|
||||
&meta_setter<Type, Data>,
|
||||
&meta_getter<Type, Data, Policy>});
|
||||
|
||||
@@ -352,10 +352,10 @@ public:
|
||||
internal::owner(*ctx, *info),
|
||||
id,
|
||||
internal::meta_data_node{
|
||||
((std::is_same_v<Type, std::remove_const_t<data_type>> || std::is_const_v<data_type>) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static,
|
||||
((std::is_same_v<Type, std::remove_cv_t<data_type>> || std::is_const_v<data_type>) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static,
|
||||
1u,
|
||||
&internal::resolve<std::remove_const_t<data_type>>,
|
||||
&meta_arg<type_list<std::remove_const_t<data_type>>>,
|
||||
&internal::resolve<std::remove_cv_t<data_type>>,
|
||||
&meta_arg<type_list<std::remove_cv_t<data_type>>>,
|
||||
&meta_setter<Type, Data>,
|
||||
&meta_getter<Type, Data, Policy>});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user