|
YOrch 1.0.0
|
Statically typed context container with a compile-time schema. More...
#include <context.hpp>
Public Member Functions | |
| constexpr | context ()=default |
| Default-constructs the context. | |
| template<typename... Us> requires (sizeof...(Us) == sizeof...(Ts)) && std::constructible_from<std::tuple<Ts...>, Us&&...> | |
| constexpr | context (Us &&... xs) |
| Explicitly constructs the context from the provided objects. | |
| template<typename T > | |
| constexpr T & | get () &noexcept |
Returns the stored object of type T. | |
| template<typename T > | |
| constexpr const T & | get () const &noexcept |
| template<typename T > | |
| constexpr T && | get () &&noexcept |
| template<typename T > | |
| constexpr const T && | get () const &&noexcept |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr bool | contains () noexcept |
| Checks whether a type is present in this context schema. | |
Public Attributes | |
| std::tuple< Ts... > | storage |
Underlying storage whose element order matches Ts.... | |
Statically typed context container with a compile-time schema.
context<Ts...> stores a fixed set of unique types in a std::tuple and exposes them through type-based access instead of runtime lookup.
| Ts | Types stored in the context. Each type must be unique. |
Definition at line 105 of file context.hpp.
|
constexprdefault |
Default-constructs the context.
This constructor is available only when every type in Ts... is default-initializable.
|
inlineexplicitconstexpr |
Explicitly constructs the context from the provided objects.
| xs | Arguments forwarded to the underlying tuple in Ts... order. |
Definition at line 129 of file context.hpp.
|
inlinestaticconstexprnoexcept |
Checks whether a type is present in this context schema.
| T | Type to query. |
true if and only if T appears exactly once in Ts.... Definition at line 138 of file context.hpp.
|
inlineconstexprnoexcept |
Definition at line 163 of file context.hpp.
|
inlineconstexprnoexcept |
Returns the stored object of type T.
| T | Type to access. |
context. Definition at line 149 of file context.hpp.
|
inlineconstexprnoexcept |
Definition at line 170 of file context.hpp.
|
inlineconstexprnoexcept |
Definition at line 156 of file context.hpp.
| std::tuple<Ts...> yorch::context< Ts >::storage |
Underlying storage whose element order matches Ts....
Definition at line 110 of file context.hpp.