瀏覽代碼

table: ::size function

Michele Caini 2 年之前
父節點
當前提交
32bd18bf08
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/entt/entity/table.hpp

+ 8 - 0
src/entt/entity/table.hpp

@@ -137,6 +137,14 @@ public:
         (std::get<container_for<Row>>(payload).shrink_to_fit(), ...);
         (std::get<container_for<Row>>(payload).shrink_to_fit(), ...);
     }
     }
 
 
+    /**
+     * @brief Returns the number of rows in a table.
+     * @return Number of rows.
+     */
+    [[nodiscard]] size_type size() const noexcept {
+        return std::get<0>(payload).size();
+    }
+
 private:
 private:
     container_type payload;
     container_type payload;
 };
 };