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.
| 1879 | |
| 1880 | // 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. |
| 1881 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 1882 | { |
| 1883 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 1884 | if (it == Data.end() || it->key != key) |
| 1885 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 1886 | return &it->val_i; |
| 1887 | } |
| 1888 | |
| 1889 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 1890 | { |
no test coverage detected