diff --git a/src/entt/container/dense_map.hpp b/src/entt/container/dense_map.hpp index 803a63b4c..19bf626a6 100644 --- a/src/entt/container/dense_map.hpp +++ b/src/entt/container/dense_map.hpp @@ -36,12 +36,12 @@ struct dense_map_node final { template dense_map_node(const std::size_t pos, Args &&...args) : next{pos}, - element{std::forward(args)...} {} + element{stl::forward(args)...} {} template dense_map_node(std::allocator_arg_t, const auto &allocator, const std::size_t pos, Args &&...args) : next{pos}, - element{entt::make_obj_using_allocator(allocator, std::forward(args)...)} {} + element{entt::make_obj_using_allocator(allocator, stl::forward(args)...)} {} dense_map_node(std::allocator_arg_t, const auto &allocator, const dense_map_node &other) : next{other.next}, @@ -272,7 +272,7 @@ class dense_map { return std::make_pair(it, false); } - packed.first().emplace_back(sparse.first()[index], std::piecewise_construct, stl::forward_as_tuple(std::forward(key)), stl::forward_as_tuple(std::forward(args)...)); + packed.first().emplace_back(sparse.first()[index], std::piecewise_construct, stl::forward_as_tuple(stl::forward(key)), stl::forward_as_tuple(stl::forward(args)...)); sparse.first()[index] = packed.first().size() - 1u; rehash_if_required(); @@ -284,11 +284,11 @@ class dense_map { const auto index = key_to_bucket(key); if(auto it = constrained_find(key, index); it != end()) { - it->second = std::forward(value); + it->second = stl::forward(value); return std::make_pair(it, false); } - packed.first().emplace_back(sparse.first()[index], std::forward(key), std::forward(value)); + packed.first().emplace_back(sparse.first()[index], stl::forward(key), stl::forward(value)); sparse.first()[index] = packed.first().size() - 1u; rehash_if_required(); @@ -536,7 +536,7 @@ public: template requires std::constructible_from std::pair insert(Arg &&value) { - return insert_or_do_nothing(std::forward(value).first, std::forward(value).second); + return insert_or_do_nothing(stl::forward(value).first, stl::forward(value).second); } /** @@ -561,13 +561,13 @@ public: */ template std::pair insert_or_assign(const key_type &key, Arg &&value) { - return insert_or_overwrite(key, std::forward(value)); + return insert_or_overwrite(key, stl::forward(value)); } /*! @copydoc insert_or_assign */ template std::pair insert_or_assign(key_type &&key, Arg &&value) { - return insert_or_overwrite(std::move(key), std::forward(value)); + return insert_or_overwrite(std::move(key), stl::forward(value)); } /** @@ -588,11 +588,11 @@ public: if constexpr(sizeof...(Args) == 0u) { return insert_or_do_nothing(key_type{}); } else if constexpr(sizeof...(Args) == 1u) { - return insert_or_do_nothing(std::forward(args).first..., std::forward(args).second...); + return insert_or_do_nothing(stl::forward(args).first..., stl::forward(args).second...); } else if constexpr(sizeof...(Args) == 2u) { - return insert_or_do_nothing(std::forward(args)...); + return insert_or_do_nothing(stl::forward(args)...); } else { - auto &node = packed.first().emplace_back(packed.first().size(), std::forward(args)...); + auto &node = packed.first().emplace_back(packed.first().size(), stl::forward(args)...); const auto index = key_to_bucket(node.element.first); if(auto it = constrained_find(node.element.first, index); it != end()) { @@ -620,13 +620,13 @@ public: */ template std::pair try_emplace(const key_type &key, Args &&...args) { - return insert_or_do_nothing(key, std::forward(args)...); + return insert_or_do_nothing(key, stl::forward(args)...); } /*! @copydoc try_emplace */ template std::pair try_emplace(key_type &&key, Args &&...args) { - return insert_or_do_nothing(std::move(key), std::forward(args)...); + return insert_or_do_nothing(std::move(key), stl::forward(args)...); } /** diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index d3fad1b39..1d4cebec3 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -235,7 +235,7 @@ class dense_set { return std::make_pair(it, false); } - packed.first().emplace_back(sparse.first()[index], std::forward(value)); + packed.first().emplace_back(sparse.first()[index], stl::forward(value)); sparse.first()[index] = packed.first().size() - 1u; rehash_if_required(); @@ -545,9 +545,9 @@ public: template std::pair emplace(Args &&...args) { if constexpr(((sizeof...(Args) == 1u) && ... && stl::is_same_v, value_type>)) { - return insert_or_do_nothing(std::forward(args)...); + return insert_or_do_nothing(stl::forward(args)...); } else { - auto &node = packed.first().emplace_back(std::piecewise_construct, stl::make_tuple(packed.first().size()), stl::forward_as_tuple(std::forward(args)...)); + auto &node = packed.first().emplace_back(std::piecewise_construct, stl::make_tuple(packed.first().size()), stl::forward_as_tuple(stl::forward(args)...)); const auto index = value_to_bucket(node.second); if(auto it = constrained_find(node.second, index); it != end()) { diff --git a/src/entt/container/table.hpp b/src/entt/container/table.hpp index eed5c5c66..a1fa7cc30 100644 --- a/src/entt/container/table.hpp +++ b/src/entt/container/table.hpp @@ -369,7 +369,7 @@ public: if constexpr(sizeof...(Args) == 0u) { return stl::forward_as_tuple(std::get(payload).emplace_back()...); } else { - return stl::forward_as_tuple(std::get(payload).emplace_back(std::forward(args))...); + return stl::forward_as_tuple(std::get(payload).emplace_back(stl::forward(args))...); } } diff --git a/src/entt/core/algorithm.hpp b/src/entt/core/algorithm.hpp index c8b725377..d36b6fe22 100644 --- a/src/entt/core/algorithm.hpp +++ b/src/entt/core/algorithm.hpp @@ -34,7 +34,7 @@ struct std_sort { */ template, typename... Args> void operator()(stl::random_access_iterator auto first, stl::random_access_iterator auto last, Compare compare = Compare{}, Args &&...args) const { - std::sort(std::forward(args)..., std::move(first), std::move(last), std::move(compare)); + std::sort(stl::forward(args)..., std::move(first), std::move(last), std::move(compare)); } }; diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index e17ec075d..73953e3c3 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -152,22 +152,22 @@ class basic_any: private internal::basic_any_storage { mode = any_policy::embedded; if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - ::new(&this->buffer) plain_type{std::forward(args)...}; + ::new(&this->buffer) plain_type{stl::forward(args)...}; } else { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay) - ::new(&this->buffer) plain_type(std::forward(args)...); + ::new(&this->buffer) plain_type(stl::forward(args)...); } } else { deleter = &basic_deleter; mode = any_policy::dynamic; if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - this->instance = new plain_type{std::forward(args)...}; + this->instance = new plain_type{stl::forward(args)...}; } else if constexpr(std::is_array_v) { static_assert(sizeof...(Args) == 0u, "Invalid arguments"); this->instance = new plain_type[std::extent_v](); } else { - this->instance = new plain_type(std::forward(args)...); + this->instance = new plain_type(stl::forward(args)...); } } } @@ -197,7 +197,7 @@ public: template explicit basic_any(std::in_place_type_t, Args &&...args) : base_type{} { - initialize(std::forward(args)...); + initialize(stl::forward(args)...); } /** @@ -226,7 +226,7 @@ public: template requires (!std::same_as, basic_any>) basic_any(Type &&value) - : basic_any{std::in_place_type>, std::forward(value)} {} + : basic_any{std::in_place_type>, stl::forward(value)} {} /** * @brief Copy constructor. @@ -311,7 +311,7 @@ public: template requires (!std::same_as, basic_any>) basic_any &operator=(Type &&value) { - emplace>(std::forward(value)); + emplace>(stl::forward(value)); return *this; } @@ -425,7 +425,7 @@ public: template void emplace(Args &&...args) { invoke_deleter_if_exists(); - initialize(std::forward(args)...); + initialize(stl::forward(args)...); } /** @@ -601,7 +601,7 @@ template */ template::length, std::size_t Align = basic_any::alignment, typename... Args> [[nodiscard]] basic_any make_any(Args &&...args) { - return basic_any{std::in_place_type, std::forward(args)...}; + return basic_any{std::in_place_type, stl::forward(args)...}; } /** @@ -614,7 +614,7 @@ template::length, std::size_t Align */ template::length, std::size_t Align = basic_any::alignment, typename Type> [[nodiscard]] basic_any forward_as_any(Type &&value) { - return basic_any{std::in_place_type, std::forward(value)}; + return basic_any{std::in_place_type, stl::forward(value)}; } } // namespace entt diff --git a/src/entt/core/compressed_pair.hpp b/src/entt/core/compressed_pair.hpp index e8c655ab2..013b47f25 100644 --- a/src/entt/core/compressed_pair.hpp +++ b/src/entt/core/compressed_pair.hpp @@ -26,11 +26,11 @@ struct compressed_pair_element { template constexpr compressed_pair_element(Arg &&arg) noexcept(std::is_nothrow_constructible_v) requires (!std::same_as, compressed_pair_element>) - : value{std::forward(arg)} {} + : value{stl::forward(arg)} {} template constexpr compressed_pair_element(stl::tuple args, std::index_sequence) noexcept(std::is_nothrow_constructible_v) - : value{std::forward(std::get(args))...} {} + : value{stl::forward(std::get(args))...} {} [[nodiscard]] constexpr reference get() noexcept { return value; @@ -58,11 +58,11 @@ struct compressed_pair_element: Type { template constexpr compressed_pair_element(Arg &&arg) noexcept(std::is_nothrow_constructible_v) requires (!std::same_as, compressed_pair_element>) - : base_type{std::forward(arg)} {} + : base_type{stl::forward(arg)} {} template constexpr compressed_pair_element(stl::tuple args, std::index_sequence) noexcept(std::is_nothrow_constructible_v) - : base_type{std::forward(std::get(args))...} {} + : base_type{stl::forward(std::get(args))...} {} [[nodiscard]] constexpr reference get() noexcept { return *this; @@ -130,8 +130,8 @@ public: */ template constexpr compressed_pair(Arg &&arg, Other &&other) noexcept(std::is_nothrow_constructible_v && std::is_nothrow_constructible_v) - : first_base{std::forward(arg)}, - second_base{std::forward(other)} {} + : first_base{stl::forward(arg)}, + second_base{stl::forward(other)} {} /** * @brief Constructs a pair by forwarding the arguments to its parts. diff --git a/src/entt/core/memory.hpp b/src/entt/core/memory.hpp index 3234bd886..097939274 100644 --- a/src/entt/core/memory.hpp +++ b/src/entt/core/memory.hpp @@ -102,7 +102,7 @@ constexpr auto allocate_unique(Allocator &allocator, Args &&...args) { auto ptr = alloc_traits::allocate(alloc, 1u); ENTT_TRY { - alloc_traits::construct(alloc, stl::to_address(ptr), std::forward(args)...); + alloc_traits::construct(alloc, stl::to_address(ptr), stl::forward(args)...); } ENTT_CATCH { alloc_traits::deallocate(alloc, ptr, 1u); @@ -120,15 +120,15 @@ struct uses_allocator_construction { template static constexpr auto args([[maybe_unused]] const Allocator &allocator, Params &&...params) noexcept { if constexpr(!std::uses_allocator_v && std::is_constructible_v) { - return stl::forward_as_tuple(std::forward(params)...); + return stl::forward_as_tuple(stl::forward(params)...); } else { static_assert(std::uses_allocator_v, "Ill-formed request"); if constexpr(std::is_constructible_v) { - return stl::tuple{std::allocator_arg, allocator, std::forward(params)...}; + return stl::tuple{std::allocator_arg, allocator, stl::forward(params)...}; } else { static_assert(std::is_constructible_v, "Ill-formed request"); - return stl::forward_as_tuple(std::forward(params)..., allocator); + return stl::forward_as_tuple(stl::forward(params)..., allocator); } } } @@ -142,8 +142,8 @@ struct uses_allocator_construction> { static constexpr auto args(const auto &allocator, std::piecewise_construct_t, First &&first, Second &&second) noexcept { return stl::make_tuple( std::piecewise_construct, - stl::apply([&allocator](auto &&...curr) { return uses_allocator_construction::args(allocator, std::forward(curr)...); }, std::forward(first)), - stl::apply([&allocator](auto &&...curr) { return uses_allocator_construction::args(allocator, std::forward(curr)...); }, std::forward(second))); + stl::apply([&allocator](auto &&...curr) { return uses_allocator_construction::args(allocator, stl::forward(curr)...); }, stl::forward(first)), + stl::apply([&allocator](auto &&...curr) { return uses_allocator_construction::args(allocator, stl::forward(curr)...); }, stl::forward(second))); } static constexpr auto args(const auto &allocator) noexcept { @@ -152,7 +152,7 @@ struct uses_allocator_construction> { template static constexpr auto args(const auto &allocator, First &&first, Second &&second) noexcept { - return uses_allocator_construction::args(allocator, std::piecewise_construct, stl::forward_as_tuple(std::forward(first)), stl::forward_as_tuple(std::forward(second))); + return uses_allocator_construction::args(allocator, std::piecewise_construct, stl::forward_as_tuple(stl::forward(first)), stl::forward_as_tuple(stl::forward(second))); } template @@ -183,7 +183,7 @@ struct uses_allocator_construction> { */ template constexpr auto uses_allocator_construction_args(const auto &allocator, Args &&...args) noexcept { - return internal::uses_allocator_construction::args(allocator, std::forward(args)...); + return internal::uses_allocator_construction::args(allocator, stl::forward(args)...); } /** @@ -200,7 +200,7 @@ constexpr auto uses_allocator_construction_args(const auto &allocator, Args &&.. */ template constexpr Type make_obj_using_allocator(const auto &allocator, Args &&...args) { - return std::make_from_tuple(internal::uses_allocator_construction::args(allocator, std::forward(args)...)); + return std::make_from_tuple(internal::uses_allocator_construction::args(allocator, stl::forward(args)...)); } /** @@ -218,7 +218,7 @@ constexpr Type make_obj_using_allocator(const auto &allocator, Args &&...args) { */ template constexpr Type *uninitialized_construct_using_allocator(Type *value, const auto &allocator, Args &&...args) { - return stl::apply([value](auto &&...curr) { return ::new(value) Type(std::forward(curr)...); }, internal::uses_allocator_construction::args(allocator, std::forward(args)...)); + return stl::apply([value](auto &&...curr) { return ::new(value) Type(stl::forward(curr)...); }, internal::uses_allocator_construction::args(allocator, stl::forward(args)...)); } } // namespace entt diff --git a/src/entt/core/tuple.hpp b/src/entt/core/tuple.hpp index d19f8c600..b33f853cf 100644 --- a/src/entt/core/tuple.hpp +++ b/src/entt/core/tuple.hpp @@ -39,9 +39,9 @@ inline constexpr bool is_tuple_v = is_tuple::value; template constexpr decltype(auto) unwrap_tuple(Type &&value) noexcept { if constexpr(stl::tuple_size_v> == 1u) { - return std::get<0>(std::forward(value)); + return std::get<0>(stl::forward(value)); } else { - return std::forward(value); + return stl::forward(value); } } @@ -58,7 +58,7 @@ struct forward_apply: private Func { */ template constexpr forward_apply(Args &&...args) noexcept(std::is_nothrow_constructible_v) - : Func{std::forward(args)...} {} + : Func{stl::forward(args)...} {} /** * @brief Forwards and applies the arguments with the underlying function. @@ -68,13 +68,13 @@ struct forward_apply: private Func { */ template constexpr decltype(auto) operator()(Type &&args) noexcept(noexcept(stl::apply(stl::declval(), args))) { - return stl::apply(static_cast(*this), std::forward(args)); + return stl::apply(static_cast(*this), stl::forward(args)); } /*! @copydoc operator()() */ template constexpr decltype(auto) operator()(Type &&args) const noexcept(noexcept(stl::apply(stl::declval(), args))) { - return stl::apply(static_cast(*this), std::forward(args)); + return stl::apply(static_cast(*this), stl::forward(args)); } }; diff --git a/src/entt/core/utility.hpp b/src/entt/core/utility.hpp index 15efc82f8..679eced21 100644 --- a/src/entt/core/utility.hpp +++ b/src/entt/core/utility.hpp @@ -66,13 +66,13 @@ struct y_combinator { */ template constexpr decltype(auto) operator()(Args &&...args) const noexcept(std::is_nothrow_invocable_v) { - return func(*this, std::forward(args)...); + return func(*this, stl::forward(args)...); } /*! @copydoc operator()() */ template constexpr decltype(auto) operator()(Args &&...args) noexcept(std::is_nothrow_invocable_v) { - return func(*this, std::forward(args)...); + return func(*this, stl::forward(args)...); } private: diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 02685dc50..be06f649f 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -597,7 +597,7 @@ public: */ template void sort(Compare compare, Sort algo = Sort{}, Args &&...args) { - sort, index_of...>(std::move(compare), std::move(algo), std::forward(args)...); + sort, index_of...>(std::move(compare), std::move(algo), stl::forward(args)...); } /** @@ -618,7 +618,7 @@ public: if(*this) { if constexpr(sizeof...(Index) == 0) { static_assert(std::is_invocable_v, "Invalid comparison function"); - descriptor->handle().sort(std::move(compare), std::move(algo), std::forward(args)...); + descriptor->handle().sort(std::move(compare), std::move(algo), stl::forward(args)...); } else { auto comp = [&compare, cpools = pools_for(std::index_sequence_for{})](const entity_type lhs, const entity_type rhs) { if constexpr(sizeof...(Index) == 1) { @@ -628,7 +628,7 @@ public: } }; - descriptor->handle().sort(std::move(comp), std::move(algo), std::forward(args)...); + descriptor->handle().sort(std::move(comp), std::move(algo), stl::forward(args)...); } } } @@ -938,7 +938,7 @@ public: if constexpr(is_applicable_v{}, stl::declval().get({})))>) { stl::apply(func, args); } else { - stl::apply([&func](auto, auto &&...less) { func(std::forward(less)...); }, args); + stl::apply([&func](auto, auto &&...less) { func(stl::forward(less)...); }, args); } } } @@ -997,7 +997,7 @@ public: */ template void sort(Compare compare, Sort algo = Sort{}, Args &&...args) const { - sort, index_of...>(std::move(compare), std::move(algo), std::forward(args)...); + sort, index_of...>(std::move(compare), std::move(algo), stl::forward(args)...); } /** @@ -1019,7 +1019,7 @@ public: if constexpr(sizeof...(Index) == 0) { static_assert(std::is_invocable_v, "Invalid comparison function"); - storage<0>()->sort_n(descriptor->length(), std::move(compare), std::move(algo), std::forward(args)...); + storage<0>()->sort_n(descriptor->length(), std::move(compare), std::move(algo), stl::forward(args)...); } else { auto comp = [&compare, &cpools](const entity_type lhs, const entity_type rhs) { if constexpr(sizeof...(Index) == 1) { @@ -1029,7 +1029,7 @@ public: } }; - storage<0>()->sort_n(descriptor->length(), std::move(comp), std::move(algo), std::forward(args)...); + storage<0>()->sort_n(descriptor->length(), std::move(comp), std::move(algo), stl::forward(args)...); } auto cb = [this](auto *head, auto *...other) { diff --git a/src/entt/entity/handle.hpp b/src/entt/entity/handle.hpp index 8d0050aa9..df1e5d9cb 100644 --- a/src/entt/entity/handle.hpp +++ b/src/entt/entity/handle.hpp @@ -195,7 +195,7 @@ public: // NOLINTNEXTLINE(modernize-use-nodiscard) decltype(auto) emplace(Args &&...args) const { static_assert(((sizeof...(Scope) == 0) || ... || stl::is_same_v), "Invalid type"); - return owner_or_assert().template emplace(entt, std::forward(args)...); + return owner_or_assert().template emplace(entt, stl::forward(args)...); } /** @@ -208,7 +208,7 @@ public: template decltype(auto) emplace_or_replace(Args &&...args) const { static_assert(((sizeof...(Scope) == 0) || ... || stl::is_same_v), "Invalid type"); - return owner_or_assert().template emplace_or_replace(entt, std::forward(args)...); + return owner_or_assert().template emplace_or_replace(entt, stl::forward(args)...); } /** @@ -221,7 +221,7 @@ public: template decltype(auto) patch(Func &&...func) const { static_assert(((sizeof...(Scope) == 0) || ... || stl::is_same_v), "Invalid type"); - return owner_or_assert().template patch(entt, std::forward(func)...); + return owner_or_assert().template patch(entt, stl::forward(func)...); } /** @@ -234,7 +234,7 @@ public: template decltype(auto) replace(Args &&...args) const { static_assert(((sizeof...(Scope) == 0) || ... || stl::is_same_v), "Invalid type"); - return owner_or_assert().template replace(entt, std::forward(args)...); + return owner_or_assert().template replace(entt, stl::forward(args)...); } /** @@ -301,7 +301,7 @@ public: template [[nodiscard]] decltype(auto) get_or_emplace(Args &&...args) const { static_assert(((sizeof...(Scope) == 0) || ... || stl::is_same_v), "Invalid type"); - return owner_or_assert().template get_or_emplace(entt, std::forward(args)...); + return owner_or_assert().template get_or_emplace(entt, stl::forward(args)...); } /** diff --git a/src/entt/entity/helper.hpp b/src/entt/entity/helper.hpp index f6dbea2db..7cc080bd7 100644 --- a/src/entt/entity/helper.hpp +++ b/src/entt/entity/helper.hpp @@ -210,7 +210,7 @@ struct sigh_helper final: sigh_helper { */ template auto on_construct(Args &&...args) { - this->registry().template on_construct(name).template connect(std::forward(args)...); + this->registry().template on_construct(name).template connect(stl::forward(args)...); return *this; } @@ -223,7 +223,7 @@ struct sigh_helper final: sigh_helper { */ template auto on_update(Args &&...args) { - this->registry().template on_update(name).template connect(std::forward(args)...); + this->registry().template on_update(name).template connect(stl::forward(args)...); return *this; } @@ -236,7 +236,7 @@ struct sigh_helper final: sigh_helper { */ template auto on_destroy(Args &&...args) { - this->registry().template on_destroy(name).template connect(std::forward(args)...); + this->registry().template on_destroy(name).template connect(stl::forward(args)...); return *this; } diff --git a/src/entt/entity/mixin.hpp b/src/entt/entity/mixin.hpp index b0d42a0b3..83d816038 100644 --- a/src/entt/entity/mixin.hpp +++ b/src/entt/entity/mixin.hpp @@ -336,7 +336,7 @@ public: */ template decltype(auto) emplace(const entity_type entt, Args &&...args) { - underlying_type::emplace(entt, std::forward(args)...); + underlying_type::emplace(entt, stl::forward(args)...); construction.publish(owner_or_assert(), entt); return this->get(entt); } @@ -350,7 +350,7 @@ public: */ template decltype(auto) patch(const entity_type entt, Func &&...func) { - underlying_type::patch(entt, std::forward(func)...); + underlying_type::patch(entt, stl::forward(func)...); update.publish(owner_or_assert(), entt); return this->get(entt); } @@ -366,7 +366,7 @@ public: template void insert(stl::input_iterator auto first, stl::input_iterator auto last, Args &&...args) { auto from = underlying_type::size(); - underlying_type::insert(first, last, std::forward(args)...); + underlying_type::insert(first, last, stl::forward(args)...); if(auto ® = owner_or_assert(); !construction.empty()) { // fine as long as insert passes force_back true to try_emplace diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index b8be6c3f3..b23b6e8df 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -144,22 +144,22 @@ public: template Type &emplace_as(const id_type id, Args &&...args) { - return any_cast(ctx.try_emplace(id, std::in_place_type, std::forward(args)...).first->second); + return any_cast(ctx.try_emplace(id, std::in_place_type, stl::forward(args)...).first->second); } template Type &emplace(Args &&...args) { - return emplace_as(type_id().hash(), std::forward(args)...); + return emplace_as(type_id().hash(), stl::forward(args)...); } 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, stl::forward(value)).first->second); } template Type &insert_or_assign(Type &&value) { - return insert_or_assign(type_id().hash(), std::forward(value)); + return insert_or_assign(type_id().hash(), stl::forward(value)); } template @@ -566,7 +566,7 @@ public: template decltype(auto) emplace(const entity_type entt, Args &&...args) { ENTT_ASSERT(valid(entt), "Invalid entity"); - return assure().emplace(entt, std::forward(args)...); + return assure().emplace(entt, stl::forward(args)...); } /** @@ -620,7 +620,7 @@ public: decltype(auto) emplace_or_replace(const entity_type entt, Args &&...args) { auto &cpool = assure(); ENTT_ASSERT(valid(entt), "Invalid entity"); - return cpool.contains(entt) ? cpool.patch(entt, [&args...](auto &...curr) { ((curr = Type{std::forward(args)...}), ...); }) : cpool.emplace(entt, std::forward(args)...); + return cpool.contains(entt) ? cpool.patch(entt, [&args...](auto &...curr) { ((curr = Type{stl::forward(args)...}), ...); }) : cpool.emplace(entt, stl::forward(args)...); } /** @@ -644,7 +644,7 @@ public: */ template decltype(auto) patch(const entity_type entt, Func &&...func) { - return assure().patch(entt, std::forward(func)...); + return assure().patch(entt, stl::forward(func)...); } /** @@ -664,7 +664,7 @@ public: */ template decltype(auto) replace(const entity_type entt, Args &&...args) { - return patch(entt, [&args...](auto &...curr) { ((curr = Type{std::forward(args)...}), ...); }); + return patch(entt, [&args...](auto &...curr) { ((curr = Type{stl::forward(args)...}), ...); }); } /** @@ -882,7 +882,7 @@ public: [[nodiscard]] decltype(auto) get_or_emplace(const entity_type entt, Args &&...args) { auto &cpool = assure(); ENTT_ASSERT(valid(entt), "Invalid entity"); - return cpool.contains(entt) ? cpool.get(entt) : cpool.emplace(entt, std::forward(args)...); + return cpool.contains(entt) ? cpool.get(entt) : cpool.emplace(entt, stl::forward(args)...); } /** @@ -1131,9 +1131,9 @@ public: if constexpr(std::is_invocable_v) { auto comp = [&cpool, compare = std::move(compare)](const auto lhs, const auto rhs) { return compare(std::as_const(cpool.get(lhs)), std::as_const(cpool.get(rhs))); }; - cpool.sort(std::move(comp), std::move(algo), std::forward(args)...); + cpool.sort(std::move(comp), std::move(algo), stl::forward(args)...); } else { - cpool.sort(std::move(compare), std::move(algo), std::forward(args)...); + cpool.sort(std::move(compare), std::move(algo), stl::forward(args)...); } } diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 056ff439c..04e43a223 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -107,12 +107,12 @@ public: archive(static_cast(null)); } else { archive(entt); - stl::apply([&archive](auto &&...args) { (archive(std::forward(args)), ...); }, storage->get_as_tuple(entt)); + stl::apply([&archive](auto &&...args) { (archive(stl::forward(args)), ...); }, storage->get_as_tuple(entt)); } } } else { for(auto elem: storage->reach()) { - stl::apply([&archive](auto &&...args) { (archive(std::forward(args)), ...); }, elem); + stl::apply([&archive](auto &&...args) { (archive(stl::forward(args)), ...); }, elem); } } } else { @@ -143,7 +143,7 @@ public: for(; first != last; ++first) { if(const auto entt = *first; storage->contains(entt)) { archive(entt); - stl::apply([&archive](auto &&...args) { (archive(std::forward(args)), ...); }, storage->get_as_tuple(entt)); + stl::apply([&archive](auto &&...args) { (archive(stl::forward(args)), ...); }, storage->get_as_tuple(entt)); } else { archive(static_cast(null)); } diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index 36623eb8f..f5bf37d96 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -967,7 +967,7 @@ public: ENTT_ASSERT((mode != deletion_policy::in_place) || (head == max_size), "Sorting with tombstones not allowed"); ENTT_ASSERT(!(length > packed.size()), "Length exceeds the number of elements"); - algo(packed.rend() - static_cast(length), packed.rend(), std::move(compare), std::forward(args)...); + algo(packed.rend() - static_cast(length), packed.rend(), std::move(compare), stl::forward(args)...); for(size_type pos{}; pos < length; ++pos) { auto curr = pos; @@ -1000,7 +1000,7 @@ public: template void sort(Compare compare, Sort algo = Sort{}, Args &&...args) { const size_type len = (mode == deletion_policy::swap_only) ? head : packed.size(); - sort_n(len, std::move(compare), std::move(algo), std::forward(args)...); + sort_n(len, std::move(compare), std::move(algo), stl::forward(args)...); } /** @@ -1060,7 +1060,7 @@ public: */ template void bind(Type &&value) noexcept { - bind_any(forward_as_any(std::forward(value))); + bind_any(forward_as_any(stl::forward(value))); } private: diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index a945148a1..499eb9c74 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -246,7 +246,7 @@ class basic_storage: public basic_sparse_set(it.index()))); - entt::uninitialized_construct_using_allocator(elem, get_allocator(), std::forward(args)...); + entt::uninitialized_construct_using_allocator(elem, get_allocator(), stl::forward(args)...); } ENTT_CATCH { base_type::pop(it, it + 1u); @@ -668,10 +668,10 @@ public: template value_type &emplace(const entity_type entt, Args &&...args) { if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - const auto it = emplace_element(entt, false, Type{std::forward(args)...}); + const auto it = emplace_element(entt, false, Type{stl::forward(args)...}); return element_at(static_cast(it.index())); } else { - const auto it = emplace_element(entt, false, std::forward(args)...); + const auto it = emplace_element(entt, false, stl::forward(args)...); return element_at(static_cast(it.index())); } } @@ -687,7 +687,7 @@ public: value_type &patch(const entity_type entt, Func &&...func) { const auto idx = base_type::index(entt); auto &elem = element_at(idx); - (std::forward(func)(elem), ...); + (stl::forward(func)(elem), ...); return elem; } @@ -903,7 +903,7 @@ public: template void patch([[maybe_unused]] const entity_type entt, Func &&...func) { ENTT_ASSERT(base_type::contains(entt), "Invalid entity"); - (std::forward(func)(), ...); + (stl::forward(func)(), ...); } /** @@ -1164,7 +1164,7 @@ public: template void patch([[maybe_unused]] const entity_type entt, Func &&...func) { ENTT_ASSERT(base_type::index(entt) < base_type::free_list(), "The requested entity is not a live one"); - (std::forward(func)(), ...); + (stl::forward(func)(), ...); } /** diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 37b4d6049..8b0668663 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -1073,7 +1073,7 @@ public: static_assert(Get::storage_policy == deletion_policy::in_place, "Unexpected storage policy"); for(const auto pack: each()) { - stl::apply([&func](const auto, auto &&...elem) { func(std::forward(elem)...); }, pack); + stl::apply([&func](const auto, auto &&...elem) { func(stl::forward(elem)...); }, pack); } } } diff --git a/src/entt/locator/locator.hpp b/src/entt/locator/locator.hpp index 9e10c9f5e..214e5c496 100644 --- a/src/entt/locator/locator.hpp +++ b/src/entt/locator/locator.hpp @@ -88,7 +88,7 @@ public: template Type = Service, typename... Args> requires std::constructible_from [[nodiscard]] static Service &value_or(Args &&...args) { - return service ? *service : emplace(std::forward(args)...); + return service ? *service : emplace(stl::forward(args)...); } /** @@ -101,7 +101,7 @@ public: template Type = Service, typename... Args> requires std::constructible_from static Service &emplace(Args &&...args) { - service = std::make_shared(std::forward(args)...); + service = std::make_shared(stl::forward(args)...); return *service; } @@ -116,7 +116,7 @@ public: template Type = Service, typename... Args> requires std::constructible_from static Service &emplace(std::allocator_arg_t, auto alloc, Args &&...args) { - service = std::allocate_shared(alloc, std::forward(args)...); + service = std::allocate_shared(alloc, stl::forward(args)...); return *service; } diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index 328bf447d..b4bac223c 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -534,7 +534,7 @@ public: */ template meta_factory custom(Args &&...args) { - base_type::custom(internal::meta_custom_node{type_id().hash(), std::make_shared(std::forward(args)...)}); + base_type::custom(internal::meta_custom_node{type_id().hash(), std::make_shared(stl::forward(args)...)}); return *this; } }; diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 1cf777584..0190adeaa 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -249,7 +249,7 @@ public: */ template explicit meta_any(std::in_place_type_t, Args &&...args) - : meta_any{locator::value_or(), std::in_place_type, std::forward(args)...} {} + : meta_any{locator::value_or(), std::in_place_type, stl::forward(args)...} {} /** * @brief Constructs a wrapper by directly initializing the new object. @@ -260,7 +260,7 @@ public: */ template explicit meta_any(const meta_ctx &area, std::in_place_type_t, Args &&...args) - : storage{std::in_place_type, std::forward(args)...}, + : storage{std::in_place_type, stl::forward(args)...}, ctx{&area}, vtable{&basic_vtable>} {} @@ -294,7 +294,7 @@ public: template requires (!std::same_as, meta_any>) meta_any(Type &&value) - : meta_any{locator::value_or(), std::forward(value)} {} + : meta_any{locator::value_or(), stl::forward(value)} {} /** * @brief Constructs a wrapper from a given value. @@ -305,7 +305,7 @@ public: template requires (!std::same_as, meta_any>) meta_any(const meta_ctx &area, Type &&value) - : meta_any{area, std::in_place_type>, std::forward(value)} {} + : meta_any{area, std::in_place_type>, stl::forward(value)} {} /** * @brief Context aware copy constructor. @@ -391,7 +391,7 @@ public: template requires (!std::same_as, meta_any>) meta_any &operator=(Type &&value) { - emplace>(std::forward(value)); + emplace>(stl::forward(value)); return *this; } @@ -550,7 +550,7 @@ public: /*! @copydoc any::emplace */ template void emplace(Args &&...args) { - storage.emplace(std::forward(args)...); + storage.emplace(stl::forward(args)...); auto *prev = stl::exchange(vtable, &basic_vtable>); node = (prev == vtable) ? node : nullptr; } @@ -672,7 +672,7 @@ private: */ template [[nodiscard]] meta_any forward_as_meta(const meta_ctx &ctx, Type &&value) { - return meta_any{ctx, std::in_place_type, std::forward(value)}; + return meta_any{ctx, std::in_place_type, stl::forward(value)}; } /** @@ -683,7 +683,7 @@ template */ template [[nodiscard]] meta_any forward_as_meta(Type &&value) { - return forward_as_meta(locator::value_or(), std::forward(value)); + return forward_as_meta(locator::value_or(), stl::forward(value)); } /*! @brief Opaque pointers to instances of any type. */ @@ -691,11 +691,11 @@ class meta_handle { template requires std::same_as, meta_any> meta_handle(int, Type &value, Args &&...args) - : any{std::forward(args)..., value.as_ref()} {} + : any{stl::forward(args)..., value.as_ref()} {} template meta_handle(char, Type &value, Args &&...args) - : any{std::forward(args)..., std::in_place_type, value} {} + : any{stl::forward(args)..., std::in_place_type, value} {} public: /*! Default constructor. */ @@ -898,7 +898,7 @@ struct meta_data: meta_object { template // NOLINTNEXTLINE(modernize-use-nodiscard) bool set(Instance &&instance, Type &&value) const { - return node_or_assert().set(meta_handle{*ctx, std::forward(instance)}, meta_any{*ctx, std::forward(value)}); + return node_or_assert().set(meta_handle{*ctx, stl::forward(instance)}, meta_any{*ctx, stl::forward(value)}); } /** @@ -909,7 +909,7 @@ struct meta_data: meta_object { */ template [[nodiscard]] meta_any get(Instance &&instance) const { - return node_or_assert().get(meta_handle{*ctx, std::forward(instance)}); + return node_or_assert().get(meta_handle{*ctx, stl::forward(instance)}); } /** @@ -1000,7 +1000,7 @@ struct meta_func: meta_object { */ template meta_any invoke(Instance &&instance, meta_any *const args, const size_type sz) const { - return (sz == arity()) ? node_or_assert().invoke(meta_handle{*ctx, std::forward(instance)}, args) : meta_any{meta_ctx_arg, *ctx}; + return (sz == arity()) ? node_or_assert().invoke(meta_handle{*ctx, stl::forward(instance)}, args) : meta_any{meta_ctx_arg, *ctx}; } /** @@ -1014,7 +1014,7 @@ struct meta_func: meta_object { template // NOLINTNEXTLINE(modernize-use-nodiscard) meta_any invoke(Instance &&instance, Args &&...args) const { - return invoke(std::forward(instance), std::array{meta_any{*ctx, std::forward(args)}...}.data(), sizeof...(Args)); + return invoke(stl::forward(instance), std::array{meta_any{*ctx, stl::forward(args)}...}.data(), sizeof...(Args)); } /*! @copydoc meta_data::traits */ @@ -1385,7 +1385,7 @@ public: */ template [[nodiscard]] meta_any construct(Args &&...args) const { - return construct(std::array{meta_any{*ctx, std::forward(args)}...}.data(), sizeof...(Args)); + return construct(std::array{meta_any{*ctx, stl::forward(args)}...}.data(), sizeof...(Args)); // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } @@ -1420,7 +1420,7 @@ public: template // NOLINTNEXTLINE(modernize-use-nodiscard) meta_any invoke(const id_type id, Instance &&instance, meta_any *const args, const size_type sz) const { - meta_handle wrapped{*ctx, std::forward(instance)}; + meta_handle wrapped{*ctx, stl::forward(instance)}; if(const auto &ref = fetch_node(); ref.details) { if(auto *elem = internal::find_member(ref.details->func, id); elem != nullptr) { @@ -1451,7 +1451,7 @@ public: template // NOLINTNEXTLINE(modernize-use-nodiscard) meta_any invoke(const id_type id, Instance &&instance, Args &&...args) const { - return invoke(id, std::forward(instance), std::array{meta_any{*ctx, std::forward(args)}...}.data(), sizeof...(Args)); + return invoke(id, stl::forward(instance), std::array{meta_any{*ctx, stl::forward(args)}...}.data(), sizeof...(Args)); } /** @@ -1467,7 +1467,7 @@ public: // NOLINTNEXTLINE(modernize-use-nodiscard) bool set(const id_type id, Instance &&instance, Type &&value) const { const auto candidate = data(id); - return candidate && candidate.set(std::forward(instance), std::forward(value)); + return candidate && candidate.set(stl::forward(instance), stl::forward(value)); } /** @@ -1480,7 +1480,7 @@ public: template [[nodiscard]] meta_any get(const id_type id, Instance &&instance) const { const auto candidate = data(id); - return candidate ? candidate.get(std::forward(instance)) : meta_any{meta_ctx_arg, *ctx}; + return candidate ? candidate.get(stl::forward(instance)) : meta_any{meta_ctx_arg, *ctx}; } /*! @copydoc meta_data::traits */ @@ -1516,17 +1516,17 @@ private: template // NOLINTNEXTLINE(modernize-use-nodiscard) meta_any meta_any::invoke(const id_type id, Args &&...args) const { - return type().invoke(id, *this, std::forward(args)...); + return type().invoke(id, *this, stl::forward(args)...); } template meta_any meta_any::invoke(const id_type id, Args &&...args) { - return type().invoke(id, *this, std::forward(args)...); + return type().invoke(id, *this, stl::forward(args)...); } template bool meta_any::set(const id_type id, Type &&value) { - return type().set(id, *this, std::forward(value)); + return type().set(id, *this, stl::forward(value)); } [[nodiscard]] inline meta_any meta_any::get(const id_type id) const { diff --git a/src/entt/meta/utility.hpp b/src/entt/meta/utility.hpp index 55b47e857..543195061 100644 --- a/src/entt/meta/utility.hpp +++ b/src/entt/meta/utility.hpp @@ -175,7 +175,7 @@ template } else if constexpr(stl::is_same_v) { return meta_any{ctx, std::in_place_type}; } else { - return meta_any{ctx, std::forward(value)}; + return meta_any{ctx, stl::forward(value)}; } } @@ -188,7 +188,7 @@ template */ template [[nodiscard]] meta_any meta_dispatch(Type &&value) { - return meta_dispatch(locator::value_or(), std::forward(value)); + return meta_dispatch(locator::value_or(), stl::forward(value)); } /*! @cond ENTT_INTERNAL */ @@ -196,11 +196,11 @@ namespace internal { template [[nodiscard]] meta_any meta_invoke_with_args(const meta_ctx &ctx, Candidate &&candidate, Args &&...args) { - if constexpr(std::is_void_v(candidate), args...))>) { - std::invoke(std::forward(candidate), args...); + if constexpr(std::is_void_v(candidate), args...))>) { + std::invoke(stl::forward(candidate), args...); return meta_any{ctx, std::in_place_type}; } else { - return meta_dispatch(ctx, std::invoke(std::forward(candidate), args...)); + return meta_dispatch(ctx, std::invoke(stl::forward(candidate), args...)); } } @@ -211,15 +211,15 @@ template, const Type &, type_list_element_t...>) { if(const auto *const clazz = instance.try_cast(); clazz && ((args + Index)->allow_cast>() && ...)) { - return meta_invoke_with_args(instance.context(), std::forward(candidate), *clazz, (args + Index)->cast>()...); + return meta_invoke_with_args(instance.context(), stl::forward(candidate), *clazz, (args + Index)->cast>()...); } } else if constexpr(std::is_invocable_v, Type &, type_list_element_t...>) { if(auto *const clazz = instance.try_cast(); clazz && ((args + Index)->allow_cast>() && ...)) { - return meta_invoke_with_args(instance.context(), std::forward(candidate), *clazz, (args + Index)->cast>()...); + return meta_invoke_with_args(instance.context(), stl::forward(candidate), *clazz, (args + Index)->cast>()...); } } else { if(((args + Index)->allow_cast>() && ...)) { - return meta_invoke_with_args(instance.context(), std::forward(candidate), (args + Index)->cast>()...); + return meta_invoke_with_args(instance.context(), stl::forward(candidate), (args + Index)->cast>()...); } } // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic) @@ -355,7 +355,7 @@ template */ template [[nodiscard]] meta_any meta_invoke(meta_handle instance, Candidate &&candidate, meta_any *const args) { - return internal::meta_invoke(*instance.operator->(), std::forward(candidate), args, std::make_index_sequence>::args_type::size>{}); + return internal::meta_invoke(*instance.operator->(), stl::forward(candidate), args, std::make_index_sequence>::args_type::size>{}); } /** @@ -421,10 +421,10 @@ 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>) { meta_any placeholder{meta_ctx_arg, ctx}; - return internal::meta_invoke(placeholder, std::forward(candidate), args, std::make_index_sequence>::args_type::size>{}); + return internal::meta_invoke(placeholder, stl::forward(candidate), args, std::make_index_sequence>::args_type::size>{}); } else { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) - waiting for C++20 (and std::span) - return internal::meta_invoke(*args, std::forward(candidate), args + 1u, std::make_index_sequence>::args_type::size>{}); + return internal::meta_invoke(*args, stl::forward(candidate), args + 1u, std::make_index_sequence>::args_type::size>{}); } } @@ -439,7 +439,7 @@ template */ template [[nodiscard]] meta_any meta_construct(Candidate &&candidate, meta_any *const args) { - return meta_construct(locator::value_or(), std::forward(candidate), args); + return meta_construct(locator::value_or(), stl::forward(candidate), args); } /** diff --git a/src/entt/poly/poly.hpp b/src/entt/poly/poly.hpp index a6b8a41e3..e923cc0aa 100644 --- a/src/entt/poly/poly.hpp +++ b/src/entt/poly/poly.hpp @@ -85,11 +85,11 @@ class poly_vtable { static void fill_vtable_entry(Ret (*&entry)(Any &, Args...)) noexcept { if constexpr(stl::is_invocable_r_v) { entry = +[](Any &, Args... args) -> Ret { - return std::invoke(Candidate, std::forward(args)...); + return std::invoke(Candidate, stl::forward(args)...); }; } else { entry = +[](Any &instance, Args... args) -> Ret { - return static_cast(std::invoke(Candidate, any_cast &>(instance), std::forward(args)...)); + return static_cast(std::invoke(Candidate, any_cast &>(instance), stl::forward(args)...)); }; } } @@ -144,9 +144,9 @@ struct poly_base { const auto &poly = static_cast(self); if constexpr(std::is_function_v>) { - return poly.vtable(poly.storage, std::forward(args)...); + return poly.vtable(poly.storage, stl::forward(args)...); } else { - return std::get(*poly.vtable)(poly.storage, std::forward(args)...); + return std::get(*poly.vtable)(poly.storage, stl::forward(args)...); } } @@ -157,9 +157,9 @@ struct poly_base { if constexpr(std::is_function_v>) { static_assert(Member == 0u, "Unknown member"); - return poly.vtable(poly.storage, std::forward(args)...); + return poly.vtable(poly.storage, stl::forward(args)...); } else { - return std::get(*poly.vtable)(poly.storage, std::forward(args)...); + return std::get(*poly.vtable)(poly.storage, stl::forward(args)...); } } }; @@ -175,7 +175,7 @@ struct poly_base { */ template decltype(auto) poly_call(Poly &&self, Args &&...args) { - return std::forward(self).template invoke(self, std::forward(args)...); + return stl::forward(self).template invoke(self, stl::forward(args)...); } /** @@ -214,7 +214,7 @@ public: */ template explicit basic_poly(std::in_place_type_t, Args &&...args) - : storage{std::in_place_type, std::forward(args)...}, + : storage{std::in_place_type, stl::forward(args)...}, vtable{poly_vtable::template instance>()} {} /** @@ -225,7 +225,7 @@ public: template requires (!std::same_as, basic_poly>) basic_poly(Type &&value) noexcept - : basic_poly{std::in_place_type>, std::forward(value)} {} + : basic_poly{std::in_place_type>, stl::forward(value)} {} /** * @brief Returns the object type info if any, `type_id()` otherwise. @@ -256,7 +256,7 @@ public: */ template void emplace(Args &&...args) { - storage.template emplace(std::forward(args)...); + storage.template emplace(stl::forward(args)...); vtable = poly_vtable::template instance>(); } diff --git a/src/entt/process/process.hpp b/src/entt/process/process.hpp index 608ddcecc..d76647012 100644 --- a/src/entt/process/process.hpp +++ b/src/entt/process/process.hpp @@ -221,7 +221,7 @@ public: template basic_process &then(Args &&...args) { const auto &allocator = next.second(); - return *(next.first() = std::allocate_shared(allocator, allocator, std::forward(args)...)); + return *(next.first() = std::allocate_shared(allocator, allocator, stl::forward(args)...)); } /** diff --git a/src/entt/process/scheduler.hpp b/src/entt/process/scheduler.hpp index 538c21a4c..a2f423c0b 100644 --- a/src/entt/process/scheduler.hpp +++ b/src/entt/process/scheduler.hpp @@ -153,7 +153,7 @@ public: template type &attach(Args &&...args) { const auto &allocator = handlers.second(); - return *handlers.first().emplace_back(std::allocate_shared(allocator, allocator, std::forward(args)...)); + return *handlers.first().emplace_back(std::allocate_shared(allocator, allocator, stl::forward(args)...)); } /** diff --git a/src/entt/resource/cache.hpp b/src/entt/resource/cache.hpp index 9703ccfa7..beec713ba 100644 --- a/src/entt/resource/cache.hpp +++ b/src/entt/resource/cache.hpp @@ -292,7 +292,7 @@ public: return {it, false}; } - return pool.first().emplace(id, pool.second()(std::forward(args)...)); + return pool.first().emplace(id, pool.second()(stl::forward(args)...)); } /** @@ -301,7 +301,7 @@ public: */ template std::pair force_load(const id_type id, Args &&...args) { - return {pool.first().insert_or_assign(id, pool.second()(std::forward(args)...)).first, true}; + return {pool.first().insert_or_assign(id, pool.second()(stl::forward(args)...)).first, true}; } /** diff --git a/src/entt/resource/loader.hpp b/src/entt/resource/loader.hpp index 54e470a02..9b19fac80 100644 --- a/src/entt/resource/loader.hpp +++ b/src/entt/resource/loader.hpp @@ -24,7 +24,7 @@ struct resource_loader { */ template result_type operator()(Args &&...args) const { - return std::make_shared(std::forward(args)...); + return std::make_shared(stl::forward(args)...); } }; diff --git a/src/entt/signal/delegate.hpp b/src/entt/signal/delegate.hpp index adc6667d7..6ed51e278 100644 --- a/src/entt/signal/delegate.hpp +++ b/src/entt/signal/delegate.hpp @@ -71,9 +71,9 @@ class delegate { template [[nodiscard]] auto wrap(std::index_sequence) noexcept { return [](const void *, Args... args) -> return_type { - [[maybe_unused]] const auto arguments = stl::forward_as_tuple(std::forward(args)...); + [[maybe_unused]] const auto arguments = stl::forward_as_tuple(stl::forward(args)...); [[maybe_unused]] constexpr auto offset = !stl::is_invocable_r_v>...> * (sizeof...(Args) - sizeof...(Index)); - return static_cast(std::invoke(Candidate, std::forward>>(std::get(arguments))...)); + return static_cast(std::invoke(Candidate, stl::forward>>(std::get(arguments))...)); }; } @@ -81,9 +81,9 @@ class delegate { [[nodiscard]] auto wrap(Type &, std::index_sequence) noexcept { return [](const void *payload, Args... args) -> return_type { Type *curr = static_cast(const_cast *>(payload)); - [[maybe_unused]] const auto arguments = stl::forward_as_tuple(std::forward(args)...); + [[maybe_unused]] const auto arguments = stl::forward_as_tuple(stl::forward(args)...); [[maybe_unused]] constexpr auto offset = !stl::is_invocable_r_v>...> * (sizeof...(Args) - sizeof...(Index)); - return static_cast(std::invoke(Candidate, *curr, std::forward>>(std::get(arguments))...)); + return static_cast(std::invoke(Candidate, *curr, stl::forward>>(std::get(arguments))...)); }; } @@ -91,9 +91,9 @@ class delegate { [[nodiscard]] auto wrap(Type *, std::index_sequence) noexcept { return [](const void *payload, Args... args) -> return_type { Type *curr = static_cast(const_cast *>(payload)); - [[maybe_unused]] const auto arguments = stl::forward_as_tuple(std::forward(args)...); + [[maybe_unused]] const auto arguments = stl::forward_as_tuple(stl::forward(args)...); [[maybe_unused]] constexpr auto offset = !stl::is_invocable_r_v>...> * (sizeof...(Args) - sizeof...(Index)); - return static_cast(std::invoke(Candidate, curr, std::forward>>(std::get(arguments))...)); + return static_cast(std::invoke(Candidate, curr, stl::forward>>(std::get(arguments))...)); }; } @@ -116,7 +116,7 @@ public: */ template delegate(connect_arg_t, Type &&...value_or_instance) noexcept { - connect(std::forward(value_or_instance)...); + connect(stl::forward(value_or_instance)...); } /** @@ -139,7 +139,7 @@ public: if constexpr(stl::is_invocable_r_v) { fn = [](const void *, Args... args) -> return_type { - return Ret(std::invoke(Candidate, std::forward(args)...)); + return Ret(std::invoke(Candidate, stl::forward(args)...)); }; } else if constexpr(std::is_member_pointer_v) { fn = wrap(internal::index_sequence_for>>(internal::function_pointer_t{})); @@ -170,7 +170,7 @@ public: if constexpr(stl::is_invocable_r_v) { fn = [](const void *payload, Args... args) -> return_type { Type *curr = static_cast(const_cast *>(payload)); - return Ret(std::invoke(Candidate, *curr, std::forward(args)...)); + return Ret(std::invoke(Candidate, *curr, stl::forward(args)...)); }; } else { fn = wrap(value_or_instance, internal::index_sequence_for(internal::function_pointer_t{})); @@ -194,7 +194,7 @@ public: if constexpr(stl::is_invocable_r_v) { fn = [](const void *payload, Args... args) -> return_type { Type *curr = static_cast(const_cast *>(payload)); - return Ret(std::invoke(Candidate, curr, std::forward(args)...)); + return Ret(std::invoke(Candidate, curr, stl::forward(args)...)); }; } else { fn = wrap(value_or_instance, internal::index_sequence_for(internal::function_pointer_t{})); @@ -260,7 +260,7 @@ public: */ Ret operator()(Args... args) const { ENTT_ASSERT(static_cast(*this), "Uninitialized delegate"); - return fn(instance, std::forward(args)...); + return fn(instance, stl::forward(args)...); } /** diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index 19cac5ae9..b8a95fa38 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -70,9 +70,9 @@ public: template void enqueue(Args &&...args) { if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - events.push_back(Type{std::forward(args)...}); + events.push_back(Type{stl::forward(args)...}); } else { - events.emplace_back(std::forward(args)...); + events.emplace_back(stl::forward(args)...); } } @@ -289,7 +289,7 @@ public: */ template void enqueue(Args &&...args) { - enqueue_hint(type_hash::value(), std::forward(args)...); + enqueue_hint(type_hash::value(), stl::forward(args)...); } /** @@ -299,7 +299,7 @@ public: */ template void enqueue(Type &&value) { - enqueue_hint(type_hash>::value(), std::forward(value)); + enqueue_hint(type_hash>::value(), stl::forward(value)); } /** @@ -311,7 +311,7 @@ public: */ template void enqueue_hint(const id_type id, Args &&...args) { - assure(id).enqueue(std::forward(args)...); + assure(id).enqueue(stl::forward(args)...); } /** @@ -322,7 +322,7 @@ public: */ template void enqueue_hint(const id_type id, Type &&value) { - assure>(id).enqueue(std::forward(value)); + assure>(id).enqueue(stl::forward(value)); } /** diff --git a/src/entt/stl/utility.hpp b/src/entt/stl/utility.hpp index 2a0960609..2cfae4928 100644 --- a/src/entt/stl/utility.hpp +++ b/src/entt/stl/utility.hpp @@ -8,6 +8,7 @@ namespace entt::stl { using std::declval; using std::exchange; +using std::forward; } // namespace entt::stl /*! @endcond */