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.
| 2468 | |
| 2469 | // 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. |
| 2470 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2471 | { |
| 2472 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 2473 | if (it == Data.end() || it->key != key) |
| 2474 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2475 | return &it->val_i; |
| 2476 | } |
| 2477 | |
| 2478 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2479 | { |
no test coverage detected