diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 0c25ff74c..979fd3e81 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -338,34 +338,6 @@ public: traverse(std::move(func), get_type_list{}); } - /** - * @brief Iterates entities and components and applies the given function - * object to them. - * - * The function object is invoked for each entity. It is provided with the - * entity itself and a set of references to non-empty components. The - * _constness_ of the components is as requested.
- * The signature of the function must be equivalent to one of the following - * forms: - * - * @code{.cpp} - * void(const entity_type, Type &...); - * void(Type &...); - * @endcode - * - * @note - * Empty types aren't explicitly instantiated and therefore they are never - * returned during iterations. - * - * @tparam Func Type of the function object to invoke. - * @param func A valid function object. - */ - template - [[deprecated("use ::each instead")]] - void less(Func func) const { - each(std::move(func)); - } - /** * @brief Sort a group according to the given comparison function. * @@ -777,34 +749,6 @@ public: traverse(std::move(func), owned_type_list{}, get_type_list{}); } - /** - * @brief Iterates entities and components and applies the given function - * object to them. - * - * The function object is invoked for each entity. It is provided with the - * entity itself and a set of references to non-empty components. The - * _constness_ of the components is as requested.
- * The signature of the function must be equivalent to one of the following - * forms: - * - * @code{.cpp} - * void(const entity_type, Type &...); - * void(Type &...); - * @endcode - * - * @note - * Empty types aren't explicitly instantiated and therefore they are never - * returned during iterations. - * - * @tparam Func Type of the function object to invoke. - * @param func A valid function object. - */ - template - [[deprecated("use ::each instead")]] - void less(Func func) const { - each(std::move(func)); - } - /** * @brief Checks whether the group can be sorted. * @return True if the group can be sorted, false otherwise. diff --git a/test/entt/entity/group.cpp b/test/entt/entity/group.cpp index d1ffd0d7f..79951e48b 100644 --- a/test/entt/entity/group.cpp +++ b/test/entt/entity/group.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -463,28 +462,28 @@ TEST(NonOwningGroup, TrackEntitiesOnComponentDestruction) { ASSERT_FALSE(cgroup.empty()); } -TEST(NonOwningGroup, Less) { +TEST(NonOwningGroup, EachWithEmptyTypes) { entt::registry registry; const auto entity = registry.create(); registry.emplace(entity); registry.emplace(entity); - registry.emplace>(entity); + registry.emplace(entity); - registry.group(entt::get>).less([entity](const auto entt, int, char) { + registry.group(entt::get).each([entity](const auto entt, int, char) { ASSERT_EQ(entity, entt); }); - registry.group(entt::get, char>).less([check = true](int, char) mutable { + registry.group(entt::get).each([check = true](int, char) mutable { ASSERT_TRUE(check); check = false; }); - registry.group(entt::get, int, char>).less([entity](const auto entt, int, char) { + registry.group(entt::get).each([entity](const auto entt, int, char) { ASSERT_EQ(entity, entt); }); - registry.group(entt::get).less([](const auto, int, char, double) { FAIL(); }); + registry.group(entt::get).each([](const auto, int, char, double) { FAIL(); }); } TEST(NonOwningGroup, FrontBack) { @@ -1058,28 +1057,28 @@ TEST(OwningGroup, TrackEntitiesOnComponentDestruction) { ASSERT_FALSE(cgroup.empty()); } -TEST(OwningGroup, Less) { +TEST(OwningGroup, EachWithEmptyTypes) { entt::registry registry; const auto entity = registry.create(); registry.emplace(entity); registry.emplace(entity); - registry.emplace>(entity); + registry.emplace(entity); - registry.group(entt::get>).less([entity](const auto entt, int, char) { + registry.group(entt::get).each([entity](const auto entt, int, char) { ASSERT_EQ(entity, entt); }); - registry.group(entt::get, int>).less([check = true](int, char) mutable { + registry.group(entt::get).each([check = true](int, char) mutable { ASSERT_TRUE(check); check = false; }); - registry.group>(entt::get).less([entity](const auto entt, int, char) { + registry.group(entt::get).each([entity](const auto entt, int, char) { ASSERT_EQ(entity, entt); }); - registry.group(entt::get).less([](const auto, double, int, char) { FAIL(); }); + registry.group(entt::get).each([](const auto, double, int, char) { FAIL(); }); } TEST(OwningGroup, FrontBack) {