From 578016d08bd2f650902064b5b5c599086b9ff5fe Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 27 Jan 2018 17:26:25 +0100 Subject: [PATCH] ImVector comment (#1577) --- imgui.h | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.h b/imgui.h index a0453eea..56725bc0 100644 --- a/imgui.h +++ b/imgui.h @@ -1073,6 +1073,7 @@ public: Capacity = new_capacity; } + // NB: &v cannot be pointing inside the ImVector Data itself! e.g. v.push_back(v[10]) is forbidden. inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; } inline void pop_back() { IM_ASSERT(Size > 0); Size--; } inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }