diff --git a/src/entt/container/dense_map.hpp b/src/entt/container/dense_map.hpp index 53a523006..9c5843b9b 100644 --- a/src/entt/container/dense_map.hpp +++ b/src/entt/container/dense_map.hpp @@ -31,7 +31,7 @@ static constexpr std::size_t dense_map_placeholder_position = (std::numeric_limi template struct dense_map_node final { - using value_type = std::pair; + using value_type = stl::pair; template dense_map_node(const std::size_t pos, Args &&...args) @@ -65,7 +65,7 @@ class dense_map_iterator final { using second_type = decltype((stl::declval()->element.second)); public: - using value_type = std::pair; + using value_type = stl::pair; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; @@ -160,7 +160,7 @@ class dense_map_local_iterator final { using second_type = decltype((stl::declval()->element.second)); public: - using value_type = std::pair; + using value_type = stl::pair; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; @@ -235,7 +235,7 @@ class dense_map { using node_type = internal::dense_map_node; using alloc_traits = std::allocator_traits; - static_assert(stl::is_same_v>, "Invalid value type"); + static_assert(stl::is_same_v>, "Invalid value type"); using sparse_container_type = stl::vector>; using packed_container_type = stl::vector>; @@ -269,14 +269,14 @@ class dense_map { const auto index = key_to_bucket(key); if(auto it = constrained_find(key, index); it != end()) { - return std::make_pair(it, false); + return stl::make_pair(it, false); } 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(); - return std::make_pair(--end(), true); + return stl::make_pair(--end(), true); } template @@ -285,14 +285,14 @@ class dense_map { if(auto it = constrained_find(key, index); it != end()) { it->second = stl::forward(value); - return std::make_pair(it, false); + return stl::make_pair(it, false); } packed.first().emplace_back(sparse.first()[index], stl::forward(key), stl::forward(value)); sparse.first()[index] = packed.first().size() - 1u; rehash_if_required(); - return std::make_pair(--end(), true); + return stl::make_pair(--end(), true); } void move_and_pop(const std::size_t pos) { @@ -320,7 +320,7 @@ public: /*! @brief Mapped type of the container. */ using mapped_type = Type; /*! @brief Key-value type of the container. */ - using value_type = std::pair; + using value_type = stl::pair; /*! @brief Unsigned integer type. */ using size_type = std::size_t; /*! @brief Signed integer type. */ @@ -520,12 +520,12 @@ public: * the element that prevented the insertion) and a bool denoting whether the * insertion took place. */ - std::pair insert(const value_type &value) { + stl::pair insert(const value_type &value) { return insert_or_do_nothing(value.first, value.second); } /*! @copydoc insert */ - std::pair insert(value_type &&value) { + stl::pair insert(value_type &&value) { return insert_or_do_nothing(stl::move(value.first), stl::move(value.second)); } @@ -535,7 +535,7 @@ public: */ template requires std::constructible_from - std::pair insert(Arg &&value) { + stl::pair insert(Arg &&value) { return insert_or_do_nothing(stl::forward(value).first, stl::forward(value).second); } @@ -560,13 +560,13 @@ public: * denoting whether the insertion took place. */ template - std::pair insert_or_assign(const key_type &key, Arg &&value) { + stl::pair insert_or_assign(const key_type &key, Arg &&value) { return insert_or_overwrite(key, stl::forward(value)); } /*! @copydoc insert_or_assign */ template - std::pair insert_or_assign(key_type &&key, Arg &&value) { + stl::pair insert_or_assign(key_type &&key, Arg &&value) { return insert_or_overwrite(stl::move(key), stl::forward(value)); } @@ -584,7 +584,7 @@ public: * insertion took place. */ template - std::pair emplace([[maybe_unused]] Args &&...args) { + stl::pair emplace([[maybe_unused]] Args &&...args) { if constexpr(sizeof...(Args) == 0u) { return insert_or_do_nothing(key_type{}); } else if constexpr(sizeof...(Args) == 1u) { @@ -597,13 +597,13 @@ public: if(auto it = constrained_find(node.element.first, index); it != end()) { packed.first().pop_back(); - return std::make_pair(it, false); + return stl::make_pair(it, false); } std::swap(node.next, sparse.first()[index]); rehash_if_required(); - return std::make_pair(--end(), true); + return stl::make_pair(--end(), true); } } @@ -619,13 +619,13 @@ public: * insertion took place. */ template - std::pair try_emplace(const key_type &key, Args &&...args) { + stl::pair try_emplace(const key_type &key, Args &&...args) { return insert_or_do_nothing(key, stl::forward(args)...); } /*! @copydoc try_emplace */ template - std::pair try_emplace(key_type &&key, Args &&...args) { + stl::pair try_emplace(key_type &&key, Args &&...args) { return insert_or_do_nothing(stl::move(key), stl::forward(args)...); } @@ -788,13 +788,13 @@ public: * @return A pair of iterators pointing to the first element and past the * last element of the range. */ - [[nodiscard]] std::pair equal_range(const key_type &key) { + [[nodiscard]] stl::pair equal_range(const key_type &key) { const auto it = find(key); return {it, it + !(it == end())}; } /*! @copydoc equal_range */ - [[nodiscard]] std::pair equal_range(const key_type &key) const { + [[nodiscard]] stl::pair equal_range(const key_type &key) const { const auto it = find(key); return {it, it + !(it == cend())}; } @@ -806,14 +806,14 @@ public: * @return A pair of iterators pointing to the first element and past the * last element of the range. */ - [[nodiscard]] std::pair equal_range(const auto &key) + [[nodiscard]] stl::pair equal_range(const auto &key) requires is_transparent_v && is_transparent_v { const auto it = find(key); return {it, it + !(it == end())}; } /*! @copydoc equal_range */ - [[nodiscard]] std::pair equal_range(const auto &key) const + [[nodiscard]] stl::pair equal_range(const auto &key) const requires is_transparent_v && is_transparent_v { const auto it = find(key); return {it, it + !(it == cend())}; diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index 48844fcf6..3ec2e9489 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -197,7 +197,7 @@ class dense_set { static constexpr std::size_t minimum_capacity = 8u; static constexpr std::size_t placeholder_position = internal::dense_set_placeholder_position; - using node_type = std::pair; + using node_type = stl::pair; using alloc_traits = std::allocator_traits; static_assert(stl::is_same_v, "Invalid value type"); using sparse_container_type = stl::vector>; @@ -232,14 +232,14 @@ class dense_set { const auto index = value_to_bucket(value); if(auto it = constrained_find(value, index); it != end()) { - return std::make_pair(it, false); + return stl::make_pair(it, false); } packed.first().emplace_back(sparse.first()[index], stl::forward(value)); sparse.first()[index] = packed.first().size() - 1u; rehash_if_required(); - return std::make_pair(--end(), true); + return stl::make_pair(--end(), true); } void move_and_pop(const std::size_t pos) { @@ -509,12 +509,12 @@ public: * the element that prevented the insertion) and a bool denoting whether the * insertion took place. */ - std::pair insert(const value_type &value) { + stl::pair insert(const value_type &value) { return insert_or_do_nothing(value); } /*! @copydoc insert */ - std::pair insert(value_type &&value) { + stl::pair insert(value_type &&value) { return insert_or_do_nothing(stl::move(value)); } @@ -543,7 +543,7 @@ public: * insertion took place. */ template - std::pair emplace(Args &&...args) { + stl::pair emplace(Args &&...args) { if constexpr(((sizeof...(Args) == 1u) && ... && stl::is_same_v, value_type>)) { return insert_or_do_nothing(stl::forward(args)...); } else { @@ -552,13 +552,13 @@ public: if(auto it = constrained_find(node.second, index); it != end()) { packed.first().pop_back(); - return std::make_pair(it, false); + return stl::make_pair(it, false); } std::swap(node.first, sparse.first()[index]); rehash_if_required(); - return std::make_pair(--end(), true); + return stl::make_pair(--end(), true); } } @@ -664,13 +664,13 @@ public: * @return A pair of iterators pointing to the first element and past the * last element of the range. */ - [[nodiscard]] std::pair equal_range(const value_type &value) { + [[nodiscard]] stl::pair equal_range(const value_type &value) { const auto it = find(value); return {it, it + !(it == end())}; } /*! @copydoc equal_range */ - [[nodiscard]] std::pair equal_range(const value_type &value) const { + [[nodiscard]] stl::pair equal_range(const value_type &value) const { const auto it = find(value); return {it, it + !(it == cend())}; } @@ -682,14 +682,14 @@ public: * @return A pair of iterators pointing to the first element and past the * last element of the range. */ - [[nodiscard]] std::pair equal_range(const auto &value) + [[nodiscard]] stl::pair equal_range(const auto &value) requires is_transparent_v && is_transparent_v { const auto it = find(value); return {it, it + !(it == end())}; } /*! @copydoc equal_range */ - [[nodiscard]] std::pair equal_range(const auto &value) const + [[nodiscard]] stl::pair equal_range(const auto &value) const requires is_transparent_v && is_transparent_v { const auto it = find(value); return {it, it + !(it == cend())}; diff --git a/src/entt/container/fwd.hpp b/src/entt/container/fwd.hpp index 2ec236b3b..662bdb984 100644 --- a/src/entt/container/fwd.hpp +++ b/src/entt/container/fwd.hpp @@ -13,7 +13,7 @@ template< typename Type, typename = std::hash, typename = std::equal_to<>, - typename = std::allocator>> + typename = std::allocator>> class dense_map; template< diff --git a/src/entt/core/memory.hpp b/src/entt/core/memory.hpp index fe1684315..28a8b0a56 100644 --- a/src/entt/core/memory.hpp +++ b/src/entt/core/memory.hpp @@ -135,8 +135,8 @@ struct uses_allocator_construction { }; template -struct uses_allocator_construction> { - using type = std::pair; +struct uses_allocator_construction> { + using type = stl::pair; template static constexpr auto args(const auto &allocator, std::piecewise_construct_t, First &&first, Second &&second) noexcept { @@ -156,12 +156,12 @@ struct uses_allocator_construction> { } template - static constexpr auto args(const auto &allocator, const std::pair &value) noexcept { + static constexpr auto args(const auto &allocator, const stl::pair &value) noexcept { return uses_allocator_construction::args(allocator, std::piecewise_construct, stl::forward_as_tuple(value.first), stl::forward_as_tuple(value.second)); } template - static constexpr auto args(const auto &allocator, std::pair &&value) noexcept { + static constexpr auto args(const auto &allocator, stl::pair &&value) noexcept { return uses_allocator_construction::args(allocator, std::piecewise_construct, stl::forward_as_tuple(stl::move(value.first)), stl::forward_as_tuple(stl::move(value.second))); } }; diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index ff18cfaf4..2ce2efa83 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -44,7 +44,7 @@ class registry_storage_iterator final { using mapped_type = std::remove_reference_t()->second)>; public: - using value_type = std::pair &>; + using value_type = stl::pair &>; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; @@ -132,7 +132,7 @@ private: template class registry_context { using alloc_traits = std::allocator_traits; - using allocator_type = alloc_traits::template rebind_alloc>>; + using allocator_type = alloc_traits::template rebind_alloc>>; public: explicit registry_context(const allocator_type &allocator) @@ -214,8 +214,8 @@ class basic_registry { using alloc_traits = std::allocator_traits; static_assert(stl::is_same_v, "Invalid value type"); // std::shared_ptr because of its type erased allocator which is useful here - using pool_container_type = dense_map, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc>>>; - using group_container_type = dense_map, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc>>>; + using pool_container_type = dense_map, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc>>>; + using group_container_type = dense_map, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc>>>; using traits_type = entt_traits; template diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 4a9bf936c..c84c16eab 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -310,7 +310,7 @@ class basic_continuous_loader { remloc[entity].second = reg->create(); } } else { - remloc.insert_or_assign(entity, std::make_pair(entt, reg->create())); + remloc.insert_or_assign(entity, stl::make_pair(entt, reg->create())); } } @@ -500,7 +500,7 @@ public: } private: - dense_map> remloc; + dense_map> remloc; registry_type *reg; }; diff --git a/src/entt/graph/adjacency_matrix.hpp b/src/entt/graph/adjacency_matrix.hpp index dffee9513..e647fb8b3 100644 --- a/src/entt/graph/adjacency_matrix.hpp +++ b/src/entt/graph/adjacency_matrix.hpp @@ -26,7 +26,7 @@ class edge_iterator { } public: - using value_type = std::pair; + using value_type = stl::pair; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; @@ -61,7 +61,7 @@ public: } [[nodiscard]] constexpr pointer operator->() const noexcept { - return std::make_pair(pos / vert, pos % vert); + return stl::make_pair(pos / vert, pos % vert); } [[nodiscard]] constexpr bool operator==(const edge_iterator &other) const noexcept { @@ -98,7 +98,7 @@ public: /*! @brief Vertex type. */ using vertex_type = size_type; /*! @brief Edge type. */ - using edge_type = std::pair; + using edge_type = stl::pair; /*! @brief Vertex iterator type. */ using vertex_iterator = iota_iterator; /*! @brief Edge iterator type. */ @@ -280,7 +280,7 @@ public: * the element that prevented the insertion) and a bool denoting whether the * insertion took place. */ - std::pair insert(const vertex_type lhs, const vertex_type rhs) { + stl::pair insert(const vertex_type lhs, const vertex_type rhs) { const auto pos = lhs * vert + rhs; if constexpr(stl::is_same_v) { diff --git a/src/entt/graph/flow.hpp b/src/entt/graph/flow.hpp index 4ce218d61..7aaec2599 100644 --- a/src/entt/graph/flow.hpp +++ b/src/entt/graph/flow.hpp @@ -31,8 +31,8 @@ class basic_flow { using alloc_traits = std::allocator_traits; static_assert(stl::is_same_v, "Invalid value type"); using task_container_type = dense_set, typename alloc_traits::template rebind_alloc>; - using ro_rw_container_type = stl::vector, typename alloc_traits::template rebind_alloc>>; - using deps_container_type = dense_map, typename alloc_traits::template rebind_alloc>>; + using ro_rw_container_type = stl::vector, typename alloc_traits::template rebind_alloc>>; + using deps_container_type = dense_map, typename alloc_traits::template rebind_alloc>>; using adjacency_matrix_type = adjacency_matrix>; void emplace(const id_type res, const bool is_rw) { diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 4a2b113af..9539bc0d5 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1688,10 +1688,10 @@ private: }; class meta_associative_container::meta_iterator final { - using vtable_type = void(const void *, std::pair *); + using vtable_type = void(const void *, stl::pair *); template - static void basic_vtable(const void *value, std::pair *other) { + static void basic_vtable(const void *value, stl::pair *other) { if(const auto &it = *static_cast(value); other) { if constexpr(KeyOnly) { other->first.emplace(*it); @@ -1705,7 +1705,7 @@ class meta_associative_container::meta_iterator final { } public: - using value_type = std::pair; + using value_type = stl::pair; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; diff --git a/src/entt/meta/range.hpp b/src/entt/meta/range.hpp index d555e125d..99f4146a1 100644 --- a/src/entt/meta/range.hpp +++ b/src/entt/meta/range.hpp @@ -19,7 +19,7 @@ struct meta_base_node; template struct meta_range_iterator final { - using value_type = std::pair; + using value_type = stl::pair; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; diff --git a/src/entt/resource/cache.hpp b/src/entt/resource/cache.hpp index 22b2d996b..b62e8be3e 100644 --- a/src/entt/resource/cache.hpp +++ b/src/entt/resource/cache.hpp @@ -30,7 +30,7 @@ class resource_cache_iterator final { friend class resource_cache_iterator; public: - using value_type = std::pair>; + using value_type = stl::pair>; using pointer = input_iterator_pointer; using reference = value_type; using difference_type = std::ptrdiff_t; @@ -127,7 +127,7 @@ template class resource_cache { using alloc_traits = std::allocator_traits; static_assert(stl::is_same_v, "Invalid value type"); - using container_allocator = alloc_traits::template rebind_alloc>; + using container_allocator = alloc_traits::template rebind_alloc>; using container_type = dense_map, container_allocator>; public: @@ -287,7 +287,7 @@ public: * insertion took place. */ template - std::pair load(const id_type id, Args &&...args) { + stl::pair load(const id_type id, Args &&...args) { if(auto it = pool.first().find(id); it != pool.first().end()) { return {it, false}; } @@ -300,7 +300,7 @@ public: * @copydetails load */ template - std::pair force_load(const id_type id, Args &&...args) { + stl::pair force_load(const id_type id, Args &&...args) { return {pool.first().insert_or_assign(id, pool.second()(stl::forward(args)...)).first, true}; } diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index 413e21df6..145108c13 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -112,7 +112,7 @@ class basic_dispatcher { using mapped_type = std::shared_ptr; using alloc_traits = std::allocator_traits; - using container_allocator = alloc_traits::template rebind_alloc>; + using container_allocator = alloc_traits::template rebind_alloc>; using container_type = dense_map, container_allocator>; template diff --git a/src/entt/signal/emitter.hpp b/src/entt/signal/emitter.hpp index 889ce3276..c229fe674 100644 --- a/src/entt/signal/emitter.hpp +++ b/src/entt/signal/emitter.hpp @@ -38,7 +38,7 @@ class emitter { using mapped_type = std::function; using alloc_traits = std::allocator_traits; - using container_allocator = alloc_traits::template rebind_alloc>; + using container_allocator = alloc_traits::template rebind_alloc>; using container_type = dense_map, container_allocator>; public: diff --git a/src/entt/stl/utility.hpp b/src/entt/stl/utility.hpp index 2e017cfa0..d0761b7a0 100644 --- a/src/entt/stl/utility.hpp +++ b/src/entt/stl/utility.hpp @@ -10,7 +10,9 @@ using std::as_const; using std::declval; using std::exchange; using std::forward; +using std::make_pair; using std::move; +using std::pair; } // namespace entt::stl /*! @endcond */