GGUI::GGCaptured struct

GGCaptured: out-of-line storage for a handler's or component function's captures.

A lambda capturing handles, numbers, and pointers is stored inline in its node. One that captures something owning memory (string, vector, shared_ptr), or that is too big, goes in a ref-counted block from KeptBlocks that every copy of the handler shares. Authors write the same lambda either way.

Public variables

std::atomic<uint32_t> Refs
copies sharing it
void(* Destroy
bool(* Equals
Equality of the captured data. Null: a block never equals another.

Variable documentation

void(* GGUI::GGCaptured::Destroy

destroys it when the last copy goes