commons 0.1.5
Header-only C++23 library of common/shared types for the C++ libraries
Loading...
Searching...
No Matches
comms::FlagRef Struct Reference

A type-erased, non-owning runtime handle to a flag. More...

#include <flag.hpp>

Collaboration diagram for comms::FlagRef:

Static Public Member Functions

template<AnyFlag F>
static FlagRef of () noexcept
 Build a FlagRef from a compile-time flag type, capturing its display metadata only if F is Displayable.
 

Public Attributes

std::string_view name
 Flag name; also the identity used for ==.
 
std::string_view category
 Owning category name.
 
const DisplayInfodisplay = nullptr
 null when the flag is not Displayable
 

Detailed Description

A type-erased, non-owning runtime handle to a flag.

name and category are views into the flag type's static NTTP-backed storage, valid for the program lifetime (the same guarantee IconifySet::set relies on). display points at the flag's DisplayInfo when it is Displayable, else is null.

Identity is the flag name: two FlagRefs compare equal iff their names match.


The documentation for this struct was generated from the following file: