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.
| 2418 | |
| 2419 | // 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. |
| 2420 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2421 | { |
| 2422 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 2423 | if (it == Data.end() || it->key != key) |
| 2424 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2425 | return &it->val_i; |
| 2426 | } |
| 2427 | |
| 2428 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2429 | { |
no test coverage detected