Просмотр исходного кода

view: drop deprecated member operator[]

Michele Caini 2 лет назад
Родитель
Сommit
00a58db0a7
2 измененных файлов с 0 добавлено и 14 удалено
  1. 0 9
      src/entt/entity/view.hpp
  2. 0 5
      test/entt/entity/view.cpp

+ 0 - 9
src/entt/entity/view.hpp

@@ -857,15 +857,6 @@ public:
         return storage()->get(entt);
         return storage()->get(entt);
     }
     }
 
 
-    /**
-     * @brief Returns the identifier that occupies the given position.
-     * @param pos Position of the element to return.
-     * @return The identifier that occupies the given position.
-     */
-    [[deprecated("use .begin()[pos] instead")]] [[nodiscard]] entity_type operator[](const size_type pos) const {
-        return base_type::begin()[pos];
-    }
-
     /**
     /**
      * @brief Returns the component assigned to the given entity.
      * @brief Returns the component assigned to the given entity.
      * @tparam Elem Type of the component to get.
      * @tparam Elem Type of the component to get.

+ 0 - 5
test/entt/entity/view.cpp

@@ -175,11 +175,6 @@ TEST(SingleComponentView, ElementAccess) {
     const auto e1 = registry.create();
     const auto e1 = registry.create();
     registry.emplace<int>(e1, 1);
     registry.emplace<int>(e1, 1);
 
 
-    for(auto i = 0u; i < view.size(); ++i) {
-        ASSERT_EQ(view[i], i ? e0 : e1);  // NOLINT
-        ASSERT_EQ(cview[i], i ? e0 : e1); // NOLINT
-    }
-
     ASSERT_EQ(view[e0], 4);
     ASSERT_EQ(view[e0], 4);
     ASSERT_EQ(cview[e1], 1);
     ASSERT_EQ(cview[e1], 1);
 }
 }