Browse Source

group: removed ::size<T>, misleading information (breaking change)

Michele Caini 5 years ago
parent
commit
f8015036a9
2 changed files with 0 additions and 33 deletions
  1. 0 20
      src/entt/entity/group.hpp
  2. 0 13
      test/entt/entity/group.cpp

+ 0 - 20
src/entt/entity/group.hpp

@@ -163,16 +163,6 @@ public:
     /*! @brief Reversed iterator type. */
     using reverse_iterator = typename basic_sparse_set<Entity>::reverse_iterator;
 
-    /**
-     * @brief Returns the number of existing components of the given type.
-     * @tparam Component Type of component of which to return the size.
-     * @return Number of existing components of the given type.
-     */
-    template<typename Component>
-    [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
-        return std::get<storage_type<Component> *>(pools)->size();
-    }
-
     /**
      * @brief Returns the number of entities that have the given components.
      * @return Number of entities that have the given components.
@@ -698,16 +688,6 @@ public:
     /*! @brief Reversed iterator type. */
     using reverse_iterator = typename basic_sparse_set<Entity>::reverse_iterator;
 
-    /**
-     * @brief Returns the number of existing components of the given type.
-     * @tparam Component Type of component of which to return the size.
-     * @return Number of existing components of the given type.
-     */
-    template<typename Component>
-    [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
-        return std::get<storage_type<Component> *>(pools)->size();
-    }
-
     /**
      * @brief Returns the number of entities that have the given components.
      * @return Number of entities that have the given components.

+ 0 - 13
test/entt/entity/group.cpp

@@ -42,20 +42,14 @@ TEST(NonOwningGroup, Functionalities) {
     ASSERT_NE(group.rbegin(), group.rend());
     ASSERT_NE(cgroup.rbegin(), cgroup.rend());
     ASSERT_EQ(group.size(), 1u);
-    ASSERT_EQ(group.size<int>(), 1u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
 
     registry.emplace<int>(e0);
 
     ASSERT_EQ(group.size(), 2u);
-    ASSERT_EQ(group.size<int>(), 2u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
 
     registry.remove<int>(e0);
 
     ASSERT_EQ(group.size(), 1u);
-    ASSERT_EQ(group.size<int>(), 1u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
 
     for(auto entity: group) {
         ASSERT_EQ(std::get<0>(cgroup.get<const int, const char>(entity)), 42);
@@ -611,21 +605,14 @@ TEST(OwningGroup, Functionalities) {
     ASSERT_NE(group.rbegin(), group.rend());
     ASSERT_NE(cgroup.rbegin(), cgroup.rend());
     ASSERT_EQ(group.size(), 1u);
-    ASSERT_EQ(group.size<int>(), 1u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
 
     registry.emplace<int>(e0);
 
     ASSERT_EQ(group.size(), 2u);
-    ASSERT_EQ(group.size<int>(), 2u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
 
     registry.remove<int>(e0);
 
     ASSERT_EQ(group.size(), 1u);
-    ASSERT_EQ(group.size<int>(), 1u);
-    ASSERT_EQ(cgroup.size<const char>(), 2u);
-
     ASSERT_EQ(*(cgroup.raw<const int>() + 0), 42);
     ASSERT_EQ(*(group.raw<int>() + 0), 42);