From 2f2fe11343536db25cfda816f8db1ddb232f56d5 Mon Sep 17 00:00:00 2001 From: skypjack Date: Wed, 17 Dec 2025 11:22:58 +0100 Subject: [PATCH] entt: std::remove_const_t> -> std::remove_cvref_t<...> --- src/entt/core/any.hpp | 8 ++++---- src/entt/core/compressed_pair.hpp | 4 ++-- src/entt/core/type_info.hpp | 12 ++++++------ src/entt/entity/registry.hpp | 2 +- src/entt/entity/view.hpp | 6 +++--- src/entt/meta/container.hpp | 4 ++-- src/entt/meta/factory.hpp | 20 ++++++++++---------- src/entt/meta/meta.hpp | 20 ++++++++++---------- src/entt/meta/node.hpp | 4 ++-- src/entt/meta/resolve.hpp | 2 +- src/entt/meta/utility.hpp | 10 +++++----- src/entt/poly/poly.hpp | 8 ++++---- src/entt/signal/emitter.hpp | 4 ++-- 13 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index 26778d91e..b9eb549bb 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -68,7 +68,7 @@ class basic_any: private internal::basic_any_storage { template static const void *basic_vtable(const request req, const basic_any &value, const void *other) { - static_assert(std::is_same_v>, Type>, "Invalid type"); + static_assert(std::is_same_v, Type>, "Invalid type"); switch(const auto *elem = static_cast(value.data()); req) { using enum internal::any_request; @@ -112,7 +112,7 @@ class basic_any: private internal::basic_any_storage { template static void basic_deleter(const basic_any &value) { - static_assert(std::is_same_v>, Type>, "Invalid type"); + static_assert(std::is_same_v, Type>, "Invalid type"); ENTT_ASSERT((value.mode == any_policy::dynamic) || ((value.mode == any_policy::embedded) && !std::is_trivially_destructible_v), "Unexpected policy"); const auto *elem = static_cast(value.data()); @@ -128,7 +128,7 @@ class basic_any: private internal::basic_any_storage { template void initialize([[maybe_unused]] Args &&...args) { - using plain_type = std::remove_const_t>; + using plain_type = std::remove_cvref_t; vtable = basic_vtable; underlying_type = type_hash::value(); @@ -559,7 +559,7 @@ template template // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved) [[nodiscard]] std::remove_const_t any_cast(basic_any &&data) noexcept { - if constexpr(std::is_copy_constructible_v>>) { + if constexpr(std::is_copy_constructible_v>) { if(auto *const instance = any_cast>(&data); instance) { return static_cast(std::move(*instance)); } diff --git a/src/entt/core/compressed_pair.hpp b/src/entt/core/compressed_pair.hpp index 6faf92202..c4c9c1e01 100644 --- a/src/entt/core/compressed_pair.hpp +++ b/src/entt/core/compressed_pair.hpp @@ -22,7 +22,7 @@ struct compressed_pair_element { // NOLINTNEXTLINE(modernize-use-equals-default) constexpr compressed_pair_element() noexcept(std::is_nothrow_default_constructible_v) {} - template>, compressed_pair_element>>> + template, compressed_pair_element>>> constexpr compressed_pair_element(Arg &&arg) noexcept(std::is_nothrow_constructible_v) : value{std::forward(arg)} {} @@ -52,7 +52,7 @@ struct compressed_pair_element) : base_type{} {} - template>, compressed_pair_element>>> + template, compressed_pair_element>>> constexpr compressed_pair_element(Arg &&arg) noexcept(std::is_nothrow_constructible_v) : base_type{std::forward(arg)} {} diff --git a/src/entt/core/type_info.hpp b/src/entt/core/type_info.hpp index 8a15c275d..0eeb4985f 100644 --- a/src/entt/core/type_info.hpp +++ b/src/entt/core/type_info.hpp @@ -146,9 +146,9 @@ struct type_info final { template // NOLINTBEGIN(modernize-use-transparent-functors) constexpr type_info(std::in_place_type_t) noexcept - : seq{type_index>>::value()}, - identifier{type_hash>>::value()}, - alias{type_name>>::value()} {} + : seq{type_index>::value()}, + identifier{type_hash>::value()}, + alias{type_name>::value()} {} // NOLINTEND(modernize-use-transparent-functors) /** @@ -257,11 +257,11 @@ private: */ template [[nodiscard]] const type_info &type_id() noexcept { - if constexpr(std::is_same_v>>) { + if constexpr(std::is_same_v>) { static const type_info instance{std::in_place_type}; return instance; } else { - return type_id>>(); + return type_id>(); } } @@ -269,7 +269,7 @@ template template // NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) [[nodiscard]] const type_info &type_id(Type &&) noexcept { - return type_id>>(); + return type_id>(); } } // namespace entt diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 2094bb57c..1eb59506c 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -180,7 +180,7 @@ public: template Type &insert_or_assign(const id_type id, Type &&value) { - return any_cast> &>(ctx.insert_or_assign(id, std::forward(value)).first->second); + return any_cast &>(ctx.insert_or_assign(id, std::forward(value)).first->second); } template diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index d85db09ca..e8a59b61d 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -24,7 +24,7 @@ static constexpr bool tombstone_check_v = ((sizeof...(Type) == 1u) && ... && (Ty template const Type *view_placeholder() { - static_assert(std::is_same_v>, Type>, "Unexpected type"); + static_assert(std::is_same_v, Type>, "Unexpected type"); static const Type placeholder{}; return &placeholder; } @@ -227,7 +227,7 @@ class basic_view; */ template class basic_common_view { - static_assert(std::is_same_v>, Type>, "Unexpected type"); + static_assert(std::is_same_v, Type>, "Unexpected type"); template friend Return internal::view_pack(const View &, const Other &, std::index_sequence, std::index_sequence, std::index_sequence, std::index_sequence); @@ -690,7 +690,7 @@ public: */ template class basic_storage_view { - static_assert(std::is_same_v>, Type>, "Unexpected type"); + static_assert(std::is_same_v, Type>, "Unexpected type"); protected: /*! @cond TURN_OFF_DOXYGEN */ diff --git a/src/entt/meta/container.hpp b/src/entt/meta/container.hpp index 95b2d1cca..690dd0502 100644 --- a/src/entt/meta/container.hpp +++ b/src/entt/meta/container.hpp @@ -63,7 +63,7 @@ inline constexpr bool reserve_aware_container_v = reserve_aware_container: */ template struct basic_meta_sequence_container_traits { - static_assert(std::is_same_v>>, "Unexpected type"); + static_assert(std::is_same_v>, "Unexpected type"); /*! @brief Unsigned integer type. */ using size_type = meta_sequence_container::size_type; @@ -187,7 +187,7 @@ struct basic_meta_sequence_container_traits { */ template struct basic_meta_associative_container_traits { - static_assert(std::is_same_v>>, "Unexpected type"); + static_assert(std::is_same_v>, "Unexpected type"); /*! @brief Unsigned integer type. */ using size_type = meta_associative_container::size_type; diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index 68d213af6..7cde3207d 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -223,7 +223,7 @@ public: */ template auto conv() noexcept { - using conv_type = std::remove_const_t>>; + using conv_type = std::remove_cvref_t>; auto *const op = +[](const meta_ctx &area, const void *instance) { return forward_as_meta(area, std::invoke(Candidate, *static_cast(instance))); }; base_type::insert_or_assign(internal::meta_conv_node{type_id().hash(), op}); return *this; @@ -240,7 +240,7 @@ public: */ template meta_factory conv() noexcept { - using conv_type = std::remove_const_t>; + using conv_type = std::remove_cvref_t; auto *const op = +[](const meta_ctx &area, const void *instance) { return forward_as_meta(area, static_cast(*static_cast(instance))); }; base_type::insert_or_assign(internal::meta_conv_node{type_id().hash(), op}); return *this; @@ -263,7 +263,7 @@ public: meta_factory ctor() noexcept { using descriptor = meta_function_helper_t; static_assert(Policy::template value, "Invalid return type for the given policy"); - static_assert(std::is_same_v>, Type>, "The function doesn't return an object of the required type"); + static_assert(std::is_same_v, Type>, "The function doesn't return an object of the required type"); base_type::insert_or_assign(internal::meta_ctor_node{type_id().hash(), descriptor::args_type::size, &meta_arg, &meta_construct}); return *this; } @@ -328,8 +328,8 @@ public: /* this is never static */ std::is_const_v> ? internal::meta_traits::is_const : internal::meta_traits::is_none, 1u, - &internal::resolve>>, - &meta_arg>>>, + &internal::resolve>, + &meta_arg>>, &meta_setter, &meta_getter}); } else { @@ -347,8 +347,8 @@ public: name, ((!std::is_pointer_v || std::is_const_v) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static, 1u, - &internal::resolve>>, - &meta_arg>>>, + &internal::resolve>, + &meta_arg>>, &meta_setter, &meta_getter}); } @@ -404,7 +404,7 @@ public: /* this is never static */ internal::meta_traits::is_const, 0u, - &internal::resolve>>, + &internal::resolve>, &meta_arg>, &meta_setter, &meta_getter}); @@ -418,7 +418,7 @@ public: /* this is never static nor const */ internal::meta_traits::is_none, 1u, - &internal::resolve>>, + &internal::resolve>, &meta_arg(args_type::size != 1u), args_type>>>, &meta_setter, &meta_getter}); @@ -464,7 +464,7 @@ public: name, (descriptor::is_const ? internal::meta_traits::is_const : internal::meta_traits::is_none) | (descriptor::is_static ? internal::meta_traits::is_static : internal::meta_traits::is_none), descriptor::args_type::size, - &internal::resolve, void, std::remove_const_t>>>, + &internal::resolve, void, std::remove_cvref_t>>, &meta_arg, &meta_invoke}); diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 2f79db035..b9aba3020 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -51,7 +51,7 @@ public: : ctx{&area}, data{&instance}, value_type_node{&internal::resolve}, - const_reference_node{&internal::resolve>>}, + const_reference_node{&internal::resolve>}, size_fn{meta_sequence_container_traits>::size}, clear_fn{meta_sequence_container_traits>::clear}, reserve_fn{meta_sequence_container_traits>::reserve}, @@ -161,7 +161,7 @@ class meta_any { template static void basic_vtable(const internal::meta_traits req, const meta_any &value, [[maybe_unused]] const void *other) { - static_assert(std::is_same_v>, Type>, "Invalid type"); + static_assert(std::is_same_v, Type>, "Invalid type"); if(req == internal::meta_traits::is_none) { value.node = &internal::resolve(internal::meta_context::from(*value.ctx)); @@ -248,7 +248,7 @@ public: explicit meta_any(const meta_ctx &area, std::in_place_type_t, Args &&...args) : storage{std::in_place_type, std::forward(args)...}, ctx{&area}, - vtable{&basic_vtable>>} {} + vtable{&basic_vtable>} {} /** * @brief Constructs a wrapper taking ownership of the passed object. @@ -470,22 +470,22 @@ public: template [[nodiscard]] meta_any allow_cast() const { if constexpr(!std::is_reference_v || std::is_const_v>) { - if(storage.has_value>>()) { + if(storage.has_value>()) { return as_ref(); } else if(*this) { - if constexpr(std::is_arithmetic_v>> || std::is_enum_v>>) { + if constexpr(std::is_arithmetic_v> || std::is_enum_v>) { if(const auto &from = fetch_node(); from.conversion_helper) { return meta_any{*ctx, static_cast(from.conversion_helper(nullptr, storage.data()))}; } } if(const auto &from = fetch_node(); from.details != nullptr) { - if(const auto *elem = internal::find_member<&internal::meta_conv_node::type>(from.details->conv, entt::type_hash>>::value()); elem != nullptr) { + if(const auto *elem = internal::find_member<&internal::meta_conv_node::type>(from.details->conv, entt::type_hash>::value()); elem != nullptr) { return elem->conv(*ctx, storage.data()); } for(auto &&curr: from.details->base) { - if(auto other = curr.resolve(internal::meta_context::from(*ctx)).from_void(*ctx, nullptr, curr.cast(storage.data())); curr.type == entt::type_hash>>::value()) { + if(auto other = curr.resolve(internal::meta_context::from(*ctx)).from_void(*ctx, nullptr, curr.cast(storage.data())); curr.type == entt::type_hash>::value()) { return other; } else if(auto from_base = std::as_const(other).template allow_cast(); from_base) { return from_base; @@ -508,9 +508,9 @@ public: if constexpr(std::is_reference_v && !std::is_const_v>) { return allow_cast &>() && (storage.policy() != any_policy::cref); } else { - if(storage.has_value>>()) { + if(storage.has_value>()) { return true; - } else if(auto other = std::as_const(*this).allow_cast>>(); other) { + } else if(auto other = std::as_const(*this).allow_cast>(); other) { if(other.storage.owner()) { std::swap(*this, other); } @@ -526,7 +526,7 @@ public: template void emplace(Args &&...args) { storage.emplace(std::forward(args)...); - auto *prev = std::exchange(vtable, &basic_vtable>>); + auto *prev = std::exchange(vtable, &basic_vtable>); node = (prev == vtable) ? node : nullptr; } diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index ac5323275..5d15bb328 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -192,7 +192,7 @@ const meta_type_node &resolve(const meta_context &) noexcept; template [[nodiscard]] const meta_type_node &meta_arg_node(const meta_context &context, type_list, const std::size_t index) noexcept { using resolve_type = const meta_type_node &(*)(const meta_context &) noexcept; - constexpr std::array list{&resolve>>...}; + constexpr std::array list{&resolve>...}; ENTT_ASSERT(index < sizeof...(Args), "Out of bounds"); return list[index](context); } @@ -278,7 +278,7 @@ auto setup_node_for() noexcept { template [[nodiscard]] const meta_type_node &resolve(const meta_context &context) noexcept { - static_assert(std::is_same_v>>, "Invalid type"); + static_assert(std::is_same_v>, "Invalid type"); static const meta_type_node node = setup_node_for(); const auto *elem = try_resolve(context, *node.info); return (elem == nullptr) ? node : *elem; diff --git a/src/entt/meta/resolve.hpp b/src/entt/meta/resolve.hpp index f9ce08242..13f8605d9 100644 --- a/src/entt/meta/resolve.hpp +++ b/src/entt/meta/resolve.hpp @@ -20,7 +20,7 @@ namespace entt { template [[nodiscard]] meta_type resolve(const meta_ctx &ctx) noexcept { const auto &context = internal::meta_context::from(ctx); - return {ctx, internal::resolve>>(context)}; + return {ctx, internal::resolve>(context)}; } /** diff --git a/src/entt/meta/utility.hpp b/src/entt/meta/utility.hpp index 9f17d11c5..5543da808 100644 --- a/src/entt/meta/utility.hpp +++ b/src/entt/meta/utility.hpp @@ -93,11 +93,11 @@ struct meta_function_descriptor : meta_function_descriptor_traits< Ret, std::conditional_t< - std::is_same_v>, Type> || std::is_base_of_v>, Type>, + std::is_same_v, Type> || std::is_base_of_v, Type>, type_list, type_list>, - !(std::is_same_v>, Type> || std::is_base_of_v>, Type>), - std::is_const_v> && (std::is_same_v>, Type> || std::is_base_of_v>, Type>)> {}; + !(std::is_same_v, Type> || std::is_base_of_v, Type>), + std::is_const_v> && (std::is_same_v, Type> || std::is_base_of_v, Type>)> {}; /** * @brief Meta function descriptor. @@ -316,7 +316,7 @@ template template [[nodiscard]] std::enable_if_t, meta_any> meta_getter(meta_handle instance) { if constexpr(std::is_member_pointer_v || std::is_function_v>>) { - if constexpr(!std::is_array_v>>>) { + if constexpr(!std::is_array_v>>) { if constexpr(std::is_invocable_v) { if(auto *clazz = instance->try_cast(); clazz) { return meta_dispatch(instance->context(), std::invoke(Data, *clazz)); @@ -418,7 +418,7 @@ template */ template [[nodiscard]] meta_any meta_construct(const meta_ctx &ctx, Candidate &&candidate, meta_any *const args) { - if constexpr(meta_function_helper_t::is_static || std::is_class_v>>) { + if constexpr(meta_function_helper_t::is_static || std::is_class_v>) { meta_any placeholder{meta_ctx_arg, ctx}; return internal::meta_invoke(placeholder, std::forward(candidate), args, std::make_index_sequence>::args_type::size>{}); } else { diff --git a/src/entt/poly/poly.hpp b/src/entt/poly/poly.hpp index 278f2e252..908bfd351 100644 --- a/src/entt/poly/poly.hpp +++ b/src/entt/poly/poly.hpp @@ -211,16 +211,16 @@ public: template explicit basic_poly(std::in_place_type_t, Args &&...args) : storage{std::in_place_type, std::forward(args)...}, - vtable{poly_vtable::template instance>>()} {} + vtable{poly_vtable::template instance>()} {} /** * @brief Constructs a poly from a given value. * @tparam Type Type of object to use to initialize the poly. * @param value An instance of an object to use to initialize the poly. */ - template>, basic_poly>>> + template, basic_poly>>> basic_poly(Type &&value) noexcept - : basic_poly{std::in_place_type>>, std::forward(value)} {} + : basic_poly{std::in_place_type>, std::forward(value)} {} /** * @brief Returns the object type info if any, `type_id()` otherwise. @@ -252,7 +252,7 @@ public: template void emplace(Args &&...args) { storage.template emplace(std::forward(args)...); - vtable = poly_vtable::template instance>>(); + vtable = poly_vtable::template instance>(); } /*! @brief Destroys contained object */ diff --git a/src/entt/signal/emitter.hpp b/src/entt/signal/emitter.hpp index dff3a9b3a..b1aec06ab 100644 --- a/src/entt/signal/emitter.hpp +++ b/src/entt/signal/emitter.hpp @@ -147,7 +147,7 @@ public: */ template void erase() { - handlers.first().erase(type_hash>>::value()); + handlers.first().erase(type_hash>::value()); } /*! @brief Disconnects all the listeners. */ @@ -162,7 +162,7 @@ public: */ template [[nodiscard]] bool contains() const { - return handlers.first().contains(type_hash>>::value()); + return handlers.first().contains(type_hash>::value()); } /**