diff --git a/src/entt/container/dense_map.hpp b/src/entt/container/dense_map.hpp index 5165f897f..372b57a2a 100644 --- a/src/entt/container/dense_map.hpp +++ b/src/entt/container/dense_map.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include "../config/config.h" #include "../core/bit.hpp" #include "../core/compressed_pair.hpp" @@ -21,6 +20,7 @@ #include "../core/memory.hpp" #include "../core/type_traits.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" namespace entt { @@ -237,8 +237,8 @@ class dense_map { using node_type = internal::dense_map_node; using alloc_traits = std::allocator_traits; static_assert(std::is_same_v>, "Invalid value type"); - using sparse_container_type = std::vector>; - using packed_container_type = std::vector>; + using sparse_container_type = stl::vector>; + using packed_container_type = stl::vector>; [[nodiscard]] std::size_t key_to_bucket(const auto &key) const noexcept { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay) diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index 11ee751e8..adab3dac4 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -13,12 +13,12 @@ #include #include #include -#include #include "../config/config.h" #include "../core/bit.hpp" #include "../core/compressed_pair.hpp" #include "../core/type_traits.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" namespace entt { @@ -201,8 +201,8 @@ class dense_set { using node_type = std::pair; using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using sparse_container_type = std::vector>; - using packed_container_type = std::vector>; + using sparse_container_type = stl::vector>; + using packed_container_type = stl::vector>; [[nodiscard]] std::size_t value_to_bucket(const auto &value) const noexcept { return fast_mod(static_cast(sparse.second()(value)), bucket_count()); diff --git a/src/entt/container/fwd.hpp b/src/entt/container/fwd.hpp index 46222634c..95c0f54fb 100644 --- a/src/entt/container/fwd.hpp +++ b/src/entt/container/fwd.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include "../stl/vector.hpp" namespace entt { @@ -31,7 +31,7 @@ class basic_table; * @tparam Type Element types. */ template -using table = basic_table...>; +using table = basic_table...>; } // namespace entt diff --git a/src/entt/core/algorithm.hpp b/src/entt/core/algorithm.hpp index d6d147016..7afe91b96 100644 --- a/src/entt/core/algorithm.hpp +++ b/src/entt/core/algorithm.hpp @@ -6,9 +6,9 @@ #include #include #include -#include #include "../stl/functional.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" namespace entt { @@ -100,7 +100,7 @@ struct radix_sort { using value_type = std::iterator_traits::value_type; using difference_type = std::iterator_traits::difference_type; - std::vector aux(static_cast(std::distance(first, last))); + stl::vector aux(static_cast(std::distance(first, last))); auto part = [getter = std::move(getter)](auto from, auto to, auto out, auto start) { constexpr auto mask = (1 << Bit) - 1; diff --git a/src/entt/entity/mixin.hpp b/src/entt/entity/mixin.hpp index be2d180ad..815e8ad60 100644 --- a/src/entt/entity/mixin.hpp +++ b/src/entt/entity/mixin.hpp @@ -9,6 +9,7 @@ #include "../core/type_info.hpp" #include "../signal/sigh.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" #include "entity.hpp" #include "fwd.hpp" @@ -394,7 +395,7 @@ class basic_reactive_mixin final: public Type { using alloc_traits = std::allocator_traits; using basic_registry_type = basic_registry; - using container_type = std::vector>; + using container_type = stl::vector>; static_assert(std::is_base_of_v, "Invalid registry type"); diff --git a/src/entt/entity/organizer.hpp b/src/entt/entity/organizer.hpp index 8838beaa7..4c7d79c86 100644 --- a/src/entt/entity/organizer.hpp +++ b/src/entt/entity/organizer.hpp @@ -4,12 +4,12 @@ #include #include #include -#include #include "../core/type_info.hpp" #include "../core/type_traits.hpp" #include "../core/utility.hpp" #include "../graph/adjacency_matrix.hpp" #include "../graph/flow.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" #include "helper.hpp" @@ -195,7 +195,7 @@ public: * @param from List of in-edges of the vertex. * @param to List of out-edges of the vertex. */ - vertex(vertex_data data, std::vector from, std::vector to) + vertex(vertex_data data, stl::vector from, stl::vector to) : node{std::move(data)}, in{std::move(from)}, out{std::move(to)} {} @@ -282,7 +282,7 @@ public: * @brief Returns the list of in-edges of a vertex. * @return The list of in-edges of a vertex. */ - [[nodiscard]] const std::vector &in_edges() const noexcept { + [[nodiscard]] const stl::vector &in_edges() const noexcept { return in; } @@ -290,7 +290,7 @@ public: * @brief Returns the list of out-edges of a vertex. * @return The list of out-edges of a vertex. */ - [[nodiscard]] const std::vector &out_edges() const noexcept { + [[nodiscard]] const stl::vector &out_edges() const noexcept { return out; } @@ -305,8 +305,8 @@ public: private: vertex_data node; - std::vector in; - std::vector out; + stl::vector in; + stl::vector out; }; /** @@ -399,13 +399,13 @@ public: * @brief Generates a task graph for the current content. * @return The adjacency list of the task graph. */ - [[nodiscard]] std::vector graph() const { - std::vector adjacency_list{}; + [[nodiscard]] stl::vector graph() const { + stl::vector adjacency_list{}; adjacency_list.reserve(vertices.size()); for(auto adjacency_matrix = builder.graph(); auto curr: adjacency_matrix.vertices()) { - std::vector in{}; - std::vector out{}; + stl::vector in{}; + stl::vector out{}; for(auto &&edge: adjacency_matrix.in_edges(curr)) { in.push_back(edge.first); @@ -428,7 +428,7 @@ public: } private: - std::vector vertices; + stl::vector vertices; flow builder; }; diff --git a/src/entt/entity/runtime_view.hpp b/src/entt/entity/runtime_view.hpp index 0cdbfc9aa..dc2934c9d 100644 --- a/src/entt/entity/runtime_view.hpp +++ b/src/entt/entity/runtime_view.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include "../stl/vector.hpp" #include "entity.hpp" #include "fwd.hpp" @@ -38,7 +38,7 @@ public: it{}, tombstone_check{} {} - runtime_view_iterator(const std::vector &cpools, iterator_type curr, const std::vector &ignore) noexcept + runtime_view_iterator(const stl::vector &cpools, iterator_type curr, const stl::vector &ignore) noexcept : pools{&cpools}, filter{&ignore}, it{curr}, @@ -83,8 +83,8 @@ public: } private: - const std::vector *pools; - const std::vector *filter; + const stl::vector *pools; + const stl::vector *filter; iterator_type it; bool tombstone_check; }; @@ -119,7 +119,7 @@ template class basic_runtime_view { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using container_type = std::vector; + using container_type = stl::vector; [[nodiscard]] auto offset() const noexcept { ENTT_ASSERT(!pools.empty(), "Invalid view"); diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index 0bdfc0b17..6f3caf387 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -8,13 +8,13 @@ #include #include #include -#include #include "../config/config.h" #include "../core/algorithm.hpp" #include "../core/any.hpp" #include "../core/bit.hpp" #include "../core/type_info.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" #include "entity.hpp" #include "fwd.hpp" @@ -140,8 +140,8 @@ template class basic_sparse_set { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using sparse_container_type = std::vector>; - using packed_container_type = std::vector; + using sparse_container_type = stl::vector>; + using packed_container_type = stl::vector; using traits_type = entt_traits; static constexpr auto max_size = static_cast(traits_type::to_entity(null)); diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index f6e52dccd..c6bb3a39f 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include "../config/config.h" #include "../core/bit.hpp" #include "../core/iterator.hpp" @@ -17,6 +16,7 @@ #include "../core/type_info.hpp" #include "../stl/iterator.hpp" #include "../stl/memory.hpp" +#include "../stl/vector.hpp" #include "component.hpp" #include "entity.hpp" #include "fwd.hpp" @@ -210,7 +210,7 @@ template class basic_storage: public basic_sparse_set::template rebind_alloc> { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using container_type = std::vector>; + using container_type = stl::vector>; using underlying_type = basic_sparse_set>; using underlying_iterator = underlying_type::basic_iterator; using traits_type = component_traits; diff --git a/src/entt/entt.hpp b/src/entt/entt.hpp index fed8616d6..d335dc7f1 100644 --- a/src/entt/entt.hpp +++ b/src/entt/entt.hpp @@ -69,4 +69,5 @@ namespace entt {} #include "stl/functional.hpp" #include "stl/iterator.hpp" #include "stl/memory.hpp" +#include "stl/vector.hpp" // IWYU pragma: end_exports diff --git a/src/entt/graph/adjacency_matrix.hpp b/src/entt/graph/adjacency_matrix.hpp index 84ce65861..a174dde63 100644 --- a/src/entt/graph/adjacency_matrix.hpp +++ b/src/entt/graph/adjacency_matrix.hpp @@ -7,9 +7,9 @@ #include #include #include -#include #include "../config/config.h" #include "../core/iterator.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" namespace entt { @@ -88,7 +88,7 @@ template Category, typename Allocator> class adjacency_matrix { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using container_type = std::vector>; + using container_type = stl::vector>; public: /*! @brief Allocator type. */ diff --git a/src/entt/graph/flow.hpp b/src/entt/graph/flow.hpp index e5625f438..c4aeaab06 100644 --- a/src/entt/graph/flow.hpp +++ b/src/entt/graph/flow.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include "../config/config.h" #include "../container/dense_map.hpp" #include "../container/dense_set.hpp" @@ -18,6 +17,7 @@ #include "../core/iterator.hpp" #include "../stl/functional.hpp" #include "../stl/iterator.hpp" +#include "../stl/vector.hpp" #include "adjacency_matrix.hpp" #include "fwd.hpp" @@ -32,7 +32,7 @@ class basic_flow { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); using task_container_type = dense_set, typename alloc_traits::template rebind_alloc>; - using ro_rw_container_type = std::vector, 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>; diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index e4fc85b2d..151e3b5e2 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1822,7 +1822,7 @@ inline bool meta_sequence_container::reserve(const size_type sz) { * @return A possibly invalid iterator to the inserted element. */ inline meta_sequence_container::iterator meta_sequence_container::insert(const iterator &it, meta_any value) { - // this abomination is necessary because only on macos value_type and const_reference are different types for std::vector + // this abomination is necessary because only on macos value_type and const_reference are different types for stl::vector if(const auto &vtype = value_type_node(internal::meta_context::from(*ctx)); !const_only && (value.allow_cast({*ctx, vtype}) || value.allow_cast({*ctx, const_reference_node(internal::meta_context::from(*ctx))}))) { const bool is_value_type = (value.type().info() == *vtype.info); return insert_fn(*ctx, const_cast(data), is_value_type ? value.base().data() : nullptr, is_value_type ? nullptr : value.base().data(), it); diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index 0cf680091..b9cecfb4e 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -7,7 +7,6 @@ #include #include #include -#include #include "../config/config.h" #include "../core/bit.hpp" #include "../core/concepts.hpp" @@ -16,6 +15,7 @@ #include "../core/type_info.hpp" #include "../core/type_traits.hpp" #include "../core/utility.hpp" +#include "../stl/vector.hpp" #include "context.hpp" #include "fwd.hpp" #include "type_traits.hpp" @@ -123,11 +123,11 @@ struct meta_template_node { }; struct meta_type_descriptor { - std::vector ctor{}; - std::vector base{}; - std::vector conv{}; - std::vector data{}; - std::vector func{}; + stl::vector ctor{}; + stl::vector base{}; + stl::vector conv{}; + stl::vector data{}; + stl::vector func{}; }; struct meta_type_node { diff --git a/src/entt/process/scheduler.hpp b/src/entt/process/scheduler.hpp index 3a766a669..a4ceffe56 100644 --- a/src/entt/process/scheduler.hpp +++ b/src/entt/process/scheduler.hpp @@ -5,9 +5,9 @@ #include #include #include -#include #include "../config/config.h" #include "../core/compressed_pair.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" #include "process.hpp" @@ -37,7 +37,7 @@ class basic_scheduler { using base_type = basic_process; using alloc_traits = std::allocator_traits; using container_allocator = alloc_traits::template rebind_alloc>; - using container_type = std::vector, container_allocator>; + using container_type = stl::vector, container_allocator>; public: /*! @brief Process type. */ diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index 21ffd1b15..d762f745f 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -6,13 +6,13 @@ #include #include #include -#include #include "../container/dense_map.hpp" #include "../core/compressed_pair.hpp" #include "../core/concepts.hpp" #include "../core/fwd.hpp" #include "../core/type_info.hpp" #include "../stl/functional.hpp" +#include "../stl/vector.hpp" #include "fwd.hpp" #include "sigh.hpp" @@ -33,7 +33,7 @@ template class dispatcher_handler final: public basic_dispatcher_handler { using alloc_traits = std::allocator_traits; using signal_type = sigh; - using container_type = std::vector>; + using container_type = stl::vector>; public: using allocator_type = Allocator; diff --git a/src/entt/signal/sigh.hpp b/src/entt/signal/sigh.hpp index 87eff724b..a70f0225d 100644 --- a/src/entt/signal/sigh.hpp +++ b/src/entt/signal/sigh.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include "../stl/vector.hpp" #include "delegate.hpp" #include "fwd.hpp" @@ -56,7 +56,7 @@ class sigh { using alloc_traits = std::allocator_traits; using delegate_type = delegate; - using container_type = std::vector>; + using container_type = stl::vector>; public: /*! @brief Allocator type. */ diff --git a/src/entt/stl/vector.hpp b/src/entt/stl/vector.hpp new file mode 100644 index 000000000..4d942d47f --- /dev/null +++ b/src/entt/stl/vector.hpp @@ -0,0 +1,16 @@ +#ifndef ENTT_STL_VECTOR_HPP +#define ENTT_STL_VECTOR_HPP + +#include "../config/config.h" + +#include + +/*! @cond ENTT_INTERNAL */ +namespace entt::stl { + +using std::vector; + +} // namespace entt::stl +/*! @endcond */ + +#endif