|
XRTraits C++ OpenXR Utilities
|
C++11/14/17 "type traits" for manipulating and reasoning about types at compile-time. More...
Classes | |
| struct | TypeWrapper |
Functions | |
| constexpr const char * | to_string (XrStructureType t) |
| constexpr const char * | getTypeName (XrStructureType t) |
| template<typename F > | |
| constexpr void | typeDispatch (XrStructureType t, F &&f) |
Variables | |
| template<typename T > | |
| constexpr bool | is_xr_tagged_type_v |
| template<typename T > | |
| constexpr bool | has_xr_type_tag_v |
| template<typename T > | |
| constexpr XrStructureType | xr_type_tag_v |
| template<typename T > | |
| constexpr bool | has_const_next_pointer_v |
| template<typename SourceType , typename TargetType > | |
| constexpr bool | same_constness |
| Do SourceType and TargetType have the same const-qualifications? More... | |
C++11/14/17 "type traits" for manipulating and reasoning about types at compile-time.
Also includes a few other constexpr (compile time or run time) functions based on generated code.
| constexpr const char* xrtraits::traits::getTypeName | ( | XrStructureType | t | ) |
Get the type name string associated with a type enum value, or nullptr if not recognized.
| constexpr const char* xrtraits::traits::to_string | ( | XrStructureType | t | ) |
Get a string corresponding to a type enum value, or nullptr if not recognized.
| constexpr void xrtraits::traits::typeDispatch | ( | XrStructureType | t, |
| F && | f | ||
| ) |
Calls your functor with a TypeWrapper<T> argument, where T is the static type matching the enum value.
If the enum value is not recognized, your functor will not be called.
| constexpr bool xrtraits::traits::has_const_next_pointer_v |
Identify if a tagged type has a const next pointer.
Removes pointer, reference, and const from type before looking it up.
| constexpr bool xrtraits::traits::has_xr_type_tag_v |
For types that are XR tagged types and have a defined enum value (type tag) for their type member, this is true.
Note: Not all types with is_xr_tagged_type_v have their own type tag: some (that primarily serve as "abstract" types) do not but are intended primarily as ways to pass references to concrete types that do have a defined type tag.
Removes pointer, reference, and const from type before looking it up.
| constexpr bool xrtraits::traits::is_xr_tagged_type_v |
true if the given type is an XR tagged type (starting with XrStructureType type; const void* next;).
Note that this does not imply that there is a (known) XrStructureType enum value (for use in the type member) that corresponds to T. For that,
Removes pointer, reference, and const from type before looking it up.
| constexpr bool xrtraits::traits::same_constness |
Do SourceType and TargetType have the same const-qualifications?
| constexpr XrStructureType xrtraits::traits::xr_type_tag_v |
Access the defined enum value (type tag) for the type member of an XR tagged type with known tag.
Removes pointer, reference, and const from type before looking it up.
1.8.13