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.
| 2356 | |
| 2357 | // 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. |
| 2358 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2359 | { |
| 2360 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 2361 | if (it == Data.end() || it->key != key) |
| 2362 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2363 | return &it->val_i; |
| 2364 | } |
| 2365 | |
| 2366 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2367 | { |
no test coverage detected