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.
| 1992 | |
| 1993 | // 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. |
| 1994 | int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) |
| 1995 | { |
| 1996 | ImGuiStoragePair* it = LowerBound(Data, key); |
| 1997 | if (it == Data.end() || it->key != key) |
| 1998 | it = Data.insert(it, ImGuiStoragePair(key, default_val)); |
| 1999 | return &it->val_i; |
| 2000 | } |
| 2001 | |
| 2002 | bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) |
| 2003 | { |
no test coverage detected