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.
| 2840 | |
| 2841 | // 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. |
| 2842 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 2843 | { |
| 2844 | ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); |
| 2845 | if (it == Data.Data + Data.Size || it->key != key) |
| 2846 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 2847 | return &it->val_i; |
| 2848 | } |
| 2849 | |
| 2850 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2851 | { |
no test coverage detected