diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index cc6a1ff49..df382eb75 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -350,12 +350,21 @@ public: return std::get *>(pools)->size(); } + /** + * @brief Estimates the number of entities iterated by the view. + * @return Estimated number of entities iterated by the view. + */ + [[nodiscard]] size_type size_hint() const ENTT_NOEXCEPT { + return (std::min)({ std::get *>(pools)->size()... }); + } + /** * @brief Estimates the number of entities iterated by the view. * @return Estimated number of entities iterated by the view. */ + [[deprecated("misleading name, use size_hint instead")]] [[nodiscard]] size_type size() const ENTT_NOEXCEPT { - return (std::min)({ std::get *>(pools)->size()... }); + return size_hint(); } /**