#include <GGUI/Public/UIContext.h>
template<typename T>
GGState class
GGState<T>: a value that lives with an element and survives re-runs.
auto bOpen = ui.State<bool>(false); ui.Button(bOpen.Get() ? "Hide" : "Show", [bOpen] { bOpen.Set(!bOpen.Get()); });
Setting a different value re-runs the declaring component on the next update. The handle is small and trivially copyable, so handlers capture it by value. It goes stale with its element: Get then returns a default T and Set does nothing.
Public static variables
- static bool bPlain constexpr
- Small trivially-copyable values are stored inline with the element; anything else in its own block, freed with the element.