From 475115c0c3615c215f87b88a74ad40f1ccec7416 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Thu, 31 Oct 2019 16:27:32 +0100 Subject: Added empty() function to pool array types --- core/pool_vector.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/pool_vector.h') diff --git a/core/pool_vector.h b/core/pool_vector.h index fbd4d630be..a698e72e18 100644 --- a/core/pool_vector.h +++ b/core/pool_vector.h @@ -385,6 +385,7 @@ public: } inline int size() const; + inline bool empty() const; T get(int p_index) const; void set(int p_index, const T &p_val); void push_back(const T &p_val); @@ -474,6 +475,12 @@ int PoolVector::size() const { return alloc ? alloc->size / sizeof(T) : 0; } +template +bool PoolVector::empty() const { + + return alloc ? alloc->size == 0 : true; +} + template T PoolVector::get(int p_index) const { -- cgit v1.2.3