MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / GetIntRef

Method GetIntRef

extern/imgui/imgui.cpp:2358–2364  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

2356
2357// 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.
2358int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val)
2359{
2360 ImGuiStoragePair* it = LowerBound(Data, key);
2361 if (it == Data.end() || it->key != key)
2362 it = Data.insert(it, ImGuiStoragePair(key, default_val));
2363 return &it->val_i;
2364}
2365
2366bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val)
2367{

Callers 1

GetOrAddByKeyMethod · 0.80

Calls 4

LowerBoundFunction · 0.85
ImGuiStoragePairClass · 0.85
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected