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.
| 2970 | |
| 2971 | // 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. |
| 2972 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2973 | { |
| 2974 | ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); |
| 2975 | if (it == Data.Data + Data.Size || it->key != key) |
| 2976 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2977 | return &it->val_i; |
| 2978 | } |
| 2979 | |
| 2980 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2981 | { |
no test coverage detected