clang-tools 20.0.0git
|
Values in a Context are indexed by typed keys. More...
#include <Context.h>
Public Member Functions | |
constexpr | Key ()=default |
Key (Key const &)=delete | |
Key & | operator= (Key const &)=delete |
Key (Key &&)=delete | |
Key & | operator= (Key &&)=delete |
Values in a Context are indexed by typed keys.
Key<T> serves two purposes:
Example: Key<int> RequestID; Key<int> Version;
Context Ctx = Context::empty().derive(RequestID, 10).derive(Version, 3); assert(*Ctx.get(RequestID) == 10); assert(*Ctx.get(Version) == 3);
Keys are typically used across multiple functions, so most of the time you would want to make them static class members or global variables.
|
constexprdefault |
|
delete |
|
delete |