From 7ed8e55fc75da2c0ba81bcb5e3c2f6528641a671 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 9 Jan 2019 16:59:48 +0100 Subject: [PATCH] ImVector: Added size_in_bytes() helper. --- imgui.h | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.h b/imgui.h index dad97c6f..9da2e9f2 100644 --- a/imgui.h +++ b/imgui.h @@ -1182,6 +1182,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 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]; }