References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
| 2294 | |
| 2295 | // References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. |
| 2296 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2297 | { |
| 2298 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 2299 | if (it == Data.end() || it->key != key) |
| 2300 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2301 | return &it->val_i; |
| 2302 | } |
| 2303 | |
| 2304 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2305 | { |
no test coverage detected