Context derive(Type &&Value) const &
Derives a child context, using an anonymous key.
static const Context & current()
Returns the context for the current thread, creating it if needed.
Context clone() const
Clone this context object.
const Type * get(const Key< Type > &Key) const
Get data stored for a typed Key.
Context derive(const Key< Type > &Key, std::decay_t< Type > Value) const &
Derives a child context It is safe to move or destroy a parent context after calling derive().
WithContextValue extends Context::current() with a single value.
Context()=default
Same as Context::empty(), please use Context::empty() instead.
static Context swapCurrent(Context Replacement)
WithContext replaces Context::current() with a provided scope.
Context & operator=(const Context &)=delete
static Context empty()
Returns an empty root context that contains no data.
Context derive(Type &&Value) &&
Context derive(const Key< Type > &Key, std::decay_t< Type > Value) &&
WithContextValue(const Key< T > &K, std::decay_t< T > V)
const Type & getExisting(const Key< Type > &Key) const
A helper to get a reference to a Key that must exist in the map.
A context is an immutable container for per-request data that must be propagated through layers that ...