| 677 | bool Contains(const T* p) const { return (p >= Buf.Data && p < Buf.Data + Buf.Size); } |
| 678 | void Clear() { for (int n = 0; n < Map.Data.Size; n++) { int idx = Map.Data[n].val_i; if (idx != -1) Buf[idx].~T(); } Map.Clear(); Buf.clear(); FreeIdx = AliveCount = 0; } |
| 679 | T* Add() { int idx = FreeIdx; if (idx == Buf.Size) { Buf.resize(Buf.Size + 1); FreeIdx++; } else { FreeIdx = *(int*)&Buf[idx]; } IM_PLACEMENT_NEW(&Buf[idx]) T(); AliveCount++; return &Buf[idx]; } |
| 680 | void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); } |
| 681 | void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; } |
| 682 | void Reserve(int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); } |
no test coverage detected