diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index ab5fad6c1..db6e803ba 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -138,7 +138,7 @@ class basic_any: private internal::basic_any_storage { this->instance = nullptr; } else if constexpr(stl::is_lvalue_reference_v) { deleter = nullptr; - mode = std::is_const_v> ? any_policy::cref : any_policy::ref; + mode = stl::is_const_v> ? any_policy::cref : any_policy::ref; static_assert((stl::is_lvalue_reference_v && ...) && (sizeof...(Args) == 1u), "Invalid arguments"); // NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion) this->instance = (std::addressof(args), ...); @@ -206,7 +206,7 @@ public: * @param value A pointer to an object to take ownership of. */ template - requires (!std::is_const_v && !stl::is_void_v) + requires (!stl::is_const_v && !stl::is_void_v) explicit basic_any(std::in_place_t, Type *value) : base_type{} { if(value == nullptr) { @@ -409,7 +409,7 @@ public: */ template [[nodiscard]] Type *data() noexcept { - if constexpr(std::is_const_v) { + if constexpr(stl::is_const_v) { return stl::as_const(*this).template data>(); } else { return (mode == any_policy::cref) ? nullptr : const_cast(stl::as_const(*this).template data>()); @@ -582,7 +582,7 @@ template /*! @copydoc any_cast */ template [[nodiscard]] Type *any_cast(basic_any *data) noexcept { - if constexpr(std::is_const_v) { + if constexpr(stl::is_const_v) { // last attempt to make wrappers for const references return their values return any_cast(&stl::as_const(*data)); } else { diff --git a/src/entt/entity/helper.hpp b/src/entt/entity/helper.hpp index 01527d375..6acba2452 100644 --- a/src/entt/entity/helper.hpp +++ b/src/entt/entity/helper.hpp @@ -61,7 +61,7 @@ template class as_group { template [[nodiscard]] auto dispatch(owned_t, get_t, exclude_t) const { - if constexpr(std::is_const_v) { + if constexpr(stl::is_const_v) { return reg->template group_if_exists(get_t{}, exclude_t{}); } else { return reg->template group...>(get_t...>{}, exclude_t...>{}); diff --git a/src/entt/entity/mixin.hpp b/src/entt/entity/mixin.hpp index 24a2af1d7..680c46f14 100644 --- a/src/entt/entity/mixin.hpp +++ b/src/entt/entity/mixin.hpp @@ -570,7 +570,7 @@ public: template [[nodiscard]] basic_view...>, exclude_t...>> view(exclude_t = exclude_t{}) { - std::conditional_t<((std::is_const_v && ...) && (std::is_const_v && ...)), const owner_type, owner_type> &parent = owner_or_assert(); + std::conditional_t<((stl::is_const_v && ...) && (stl::is_const_v && ...)), const owner_type, owner_type> &parent = owner_or_assert(); return {*this, parent.template storage>()..., parent.template storage>()...}; } diff --git a/src/entt/entity/organizer.hpp b/src/entt/entity/organizer.hpp index b2a839ab7..0c89f19bb 100644 --- a/src/entt/entity/organizer.hpp +++ b/src/entt/entity/organizer.hpp @@ -39,12 +39,12 @@ inline constexpr bool is_group_v = is_group::value; template struct unpack_type { using ro = std::conditional_t< - type_list_contains_v || (std::is_const_v && !type_list_contains_v>), + type_list_contains_v || (stl::is_const_v && !type_list_contains_v>), type_list>, type_list<>>; using rw = std::conditional_t< - type_list_contains_v> || (!std::is_const_v && !type_list_contains_v), + type_list_contains_v> || (!stl::is_const_v && !type_list_contains_v), type_list, type_list<>>; }; diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 4ac1ef277..cb896d9d1 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -43,7 +43,7 @@ void orphans(Registry ®istry) { */ template class basic_snapshot { - static_assert(!std::is_const_v, "Non-const registry type required"); + static_assert(!stl::is_const_v, "Non-const registry type required"); using traits_type = entt_traits; public: @@ -171,7 +171,7 @@ private: */ template class basic_snapshot_loader { - static_assert(!std::is_const_v, "Non-const registry type required"); + static_assert(!stl::is_const_v, "Non-const registry type required"); using traits_type = entt_traits; public: @@ -301,7 +301,7 @@ private: */ template class basic_continuous_loader { - static_assert(!std::is_const_v, "Non-const registry type required"); + static_assert(!stl::is_const_v, "Non-const registry type required"); using traits_type = entt_traits; void restore(Registry::entity_type entt) { diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 626ab2ccb..9e332b598 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -35,7 +35,7 @@ class storage_iterator final { using alloc_traits = std::allocator_traits; using iterator_traits = stl::iterator_traits, + stl::is_const_v, typename alloc_traits::template rebind_traits::element_type>::const_pointer, typename alloc_traits::template rebind_traits::element_type>::pointer>>; @@ -53,7 +53,7 @@ public: offset{idx} {} template> Other> - requires std::is_const_v + requires stl::is_const_v constexpr storage_iterator(const storage_iterator &other) noexcept : storage_iterator{other.payload, other.offset} {} diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index ac07df456..8d051b8f8 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -363,7 +363,7 @@ public: id, name, /* this is never static */ - std::is_const_v> ? internal::meta_traits::is_const : internal::meta_traits::is_none, + stl::is_const_v> ? internal::meta_traits::is_const : internal::meta_traits::is_none, 1u, &internal::resolve>, &meta_arg>>, @@ -382,7 +382,7 @@ public: internal::meta_data_node{ id, name, - ((!stl::is_pointer_v || std::is_const_v) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static, + ((!stl::is_pointer_v || stl::is_const_v) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static, 1u, &internal::resolve>, &meta_arg>>, diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 1eb6d4671..728c33174 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -76,7 +76,7 @@ public: begin_end_fn{meta_sequence_container_traits>::iter}, insert_fn{meta_sequence_container_traits>::insert}, erase_fn{meta_sequence_container_traits>::erase}, - const_only{std::is_const_v} {} + const_only{stl::is_const_v} {} [[nodiscard]] inline meta_type value_type() const noexcept; [[nodiscard]] inline size_type size() const noexcept; @@ -137,7 +137,7 @@ public: insert_fn{&meta_associative_container_traits>::insert}, erase_fn{&meta_associative_container_traits>::erase}, find_fn{&meta_associative_container_traits>::find}, - const_only{std::is_const_v} { + const_only{stl::is_const_v} { if constexpr(!meta_associative_container_traits>::key_only) { mapped_type_node = &internal::resolve; } @@ -449,7 +449,7 @@ public: /*! @copydoc try_cast */ template [[nodiscard]] Type *try_cast() { - return ((storage.policy() == any_policy::cref) && !std::is_const_v) ? nullptr : const_cast(stl::as_const(*this).try_cast>()); + return ((storage.policy() == any_policy::cref) && !stl::is_const_v) ? nullptr : const_cast(stl::as_const(*this).try_cast>()); } /** @@ -494,7 +494,7 @@ public: */ template [[nodiscard]] meta_any allow_cast() const { - if constexpr(!std::is_reference_v || std::is_const_v>) { + if constexpr(!std::is_reference_v || stl::is_const_v>) { if(storage.has_value>()) { return as_ref(); } else if(*this) { @@ -530,7 +530,7 @@ public: */ template [[nodiscard]] bool allow_cast() { - if constexpr(std::is_reference_v && !std::is_const_v>) { + if constexpr(std::is_reference_v && !stl::is_const_v>) { return allow_cast &>() && (storage.policy() != any_policy::cref); } else { if(storage.has_value>()) { diff --git a/src/entt/meta/policy.hpp b/src/entt/meta/policy.hpp index 1059a382b..cd0b3635b 100644 --- a/src/entt/meta/policy.hpp +++ b/src/entt/meta/policy.hpp @@ -33,7 +33,7 @@ struct as_void_t final: private internal::meta_policy { struct as_ref_t final: private internal::meta_policy { /*! @cond ENTT_INTERNAL */ template - static constexpr bool value = std::is_reference_v && !std::is_const_v>; + static constexpr bool value = std::is_reference_v && !stl::is_const_v>; /*! @endcond */ }; diff --git a/src/entt/meta/utility.hpp b/src/entt/meta/utility.hpp index b7435a2e5..90e4a3029 100644 --- a/src/entt/meta/utility.hpp +++ b/src/entt/meta/utility.hpp @@ -97,7 +97,7 @@ struct meta_function_descriptor type_list, type_list>, !(stl::is_same_v, Type> || std::is_base_of_v, Type>), - std::is_const_v> && (stl::is_same_v, Type> || std::is_base_of_v, Type>)> {}; + stl::is_const_v> && (stl::is_same_v, Type> || std::is_base_of_v, Type>)> {}; /** * @brief Meta function descriptor. @@ -286,7 +286,7 @@ template } else if constexpr(stl::is_member_object_pointer_v) { using data_type = stl::remove_reference_t::return_type>; - if constexpr(!std::is_array_v && !std::is_const_v) { + if constexpr(!std::is_array_v && !stl::is_const_v) { if(auto *const clazz = instance->try_cast(); clazz && value.allow_cast()) { std::invoke(Data, *clazz) = value.cast(); return true; @@ -295,7 +295,7 @@ template } else if constexpr(stl::is_pointer_v) { using data_type = stl::remove_reference_t; - if constexpr(!std::is_array_v && !std::is_const_v) { + if constexpr(!std::is_array_v && !stl::is_const_v) { if(value.allow_cast()) { *Data = value.cast(); return true; diff --git a/src/entt/stl/type_traits.hpp b/src/entt/stl/type_traits.hpp index e4c7eb5df..7d28724ff 100644 --- a/src/entt/stl/type_traits.hpp +++ b/src/entt/stl/type_traits.hpp @@ -10,6 +10,7 @@ using std::decay_t; using std::false_type; using std::invoke_result_t; using std::is_aggregate_v; +using std::is_const_v; using std::is_default_constructible_v; using std::is_invocable_r_v; using std::is_lvalue_reference_v;