From dd4a29127260f84f081127d41a7b1df537428186 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 18 Apr 2024 16:44:30 +0200 Subject: [PATCH] table: ::empty function --- src/entt/entity/table.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/entt/entity/table.hpp b/src/entt/entity/table.hpp index 336e36dd4..dde06cb7d 100644 --- a/src/entt/entity/table.hpp +++ b/src/entt/entity/table.hpp @@ -145,6 +145,14 @@ public: return std::get<0>(payload).size(); } + /** + * @brief Checks whether a table is empty. + * @return True if the table is empty, false otherwise. + */ + [[nodiscard]] bool empty() const noexcept { + return std::get<0>(payload).empty(); + } + private: container_type payload; };