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.
| 2799 | |
| 2800 | // 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. |
| 2801 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2802 | { |
| 2803 | ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); |
| 2804 | if (it == Data.Data + Data.Size || it->key != key) |
| 2805 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2806 | return &it->val_i; |
| 2807 | } |
| 2808 | |
| 2809 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2810 | { |
no test coverage detected