From 4448734041bfff23c86dbc68dac88e69df112536 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 26 Aug 2020 11:03:55 +0200 Subject: [PATCH] ImVector: added max_size() to facilitate usage with sol2 binding generator (#3429) --- imgui.h | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.h b/imgui.h index 65a1e304..27ef591d 100644 --- a/imgui.h +++ b/imgui.h @@ -1395,6 +1395,7 @@ struct ImVector inline bool empty() const { return Size == 0; } inline int size() const { return Size; } inline int size_in_bytes() const { return Size * (int)sizeof(T); } + inline int max_size() const { return (~(unsigned int)0) / (int)sizeof(T); } inline int capacity() const { return Capacity; } inline T& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; } inline const T& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; }