diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 0bcd02f72..b02fdb344 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -132,13 +132,6 @@ class basic_group, get_t, exclude_t> { template static constexpr std::size_t index_of = type_list_index_v, type_list>; - /*! @brief A registry is allowed to create groups. */ - friend class basic_registry; - - basic_group(basic_common_type &ref, Get &...gpool) noexcept - : handler{&ref}, - pools{&gpool...} {} - public: /*! @brief Underlying entity identifier. */ using entity_type = underlying_type; @@ -157,6 +150,15 @@ public: basic_group() noexcept : handler{} {} + /** + * @brief Constructs a group from a set of storage classes. + * @param ref The actual entities to iterate. + * @param gpool Storage types to iterate _observed_ by the group. + */ + basic_group(basic_common_type &ref, Get &...gpool) noexcept + : handler{&ref}, + pools{&gpool...} {} + /** * @brief Returns a const reference to the underlying handler. * @return A const reference to the underlying handler. @@ -523,16 +525,9 @@ class basic_group, get_t, exclude_t> { using underlying_type = std::common_type_t; using basic_common_type = std::common_type_t; - /*! @brief A registry is allowed to create groups. */ - friend class basic_registry; - template static constexpr std::size_t index_of = type_list_index_v, type_list>; - basic_group(const std::size_t &extent, Owned &...opool, Get &...gpool) noexcept - : pools{&opool..., &gpool...}, - length{&extent} {} - public: /*! @brief Underlying entity identifier. */ using entity_type = underlying_type; @@ -551,6 +546,16 @@ public: basic_group() noexcept : length{} {} + /** + * @brief Constructs a group from a set of storage classes. + * @param extent The actual number of entities to iterate. + * @param opool Storage types to iterate _owned_ by the group. + * @param gpool Storage types to iterate _observed_ by the group. + */ + basic_group(const std::size_t &extent, Owned &...opool, Get &...gpool) noexcept + : pools{&opool..., &gpool...}, + length{&extent} {} + /** * @brief Returns the storage for a given component type. * @tparam Type Type of component of which to return the storage.