MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / push_back

Function push_back

KBotExt/imgui/imgui.h:1860–1860  ·  view source on GitHub ↗

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

Source from the content-addressed store, hash-verified

1858
1859 // NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
1860 inline void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; }
1861 inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
1862 inline void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); }
1863 inline T* erase(const T* it) { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; }

Callers 1

push_frontFunction · 0.85

Calls 2

reserveFunction · 0.85
_grow_capacityFunction · 0.85

Tested by

no test coverage detected