Functions | |
| template<typename VariantT , typename U , std::size_t... I> | |
| constexpr bool | variant_has_type_impl (std::index_sequence< I... > seq) noexcept |
Fold: is stripped U one of VariantT's alternatives? | |
Endian | |
| template<typename U > requires TriviallyCopyable<U> && (sizeof(U) > 0) | |
| constexpr U | swap_endian (U val) noexcept |
Reverses the object-representation byte order of val. | |
Variables | |
| template<typename T > | |
| constexpr bool | ArrayV = false |
Primary: T is not std::array. | |
| template<typename T > | |
| constexpr bool | is_variant_v = false |
true when T is exactly std::variant after stripping cv and references. | |
| template<typename VariantT , typename U > | |
| constexpr bool | variant_has_type_v |
| Convenience wrapper around StormByte::Type::Detail::variant_has_type_impl. | |
|
constexprnoexcept |
Reverses the object-representation byte order of val.
| U | Trivially copyable value type. |
| [in] | val | Value whose bytes are reversed. |
val with endianness swapped.This always reverses bytes. Whether the caller should invoke it (host ≠ little-endian) is Serializable's job. Integrals go through std::byteswap; every other trivial type goes through std::bit_cast + reverse so float, enum and small POD structs stay defined.
std::endian test.
|
constexprnoexcept |
Fold: is stripped U one of VariantT's alternatives?
| VariantT | A std::variant (already stripped by the caller). |
| U | Candidate alternative. |
| I | Index pack over std::variant_size_v<VariantT>. |
| [in] | seq | Index sequence; unused except to expand I. |
true if U matches any alternative.
|
inlineconstexpr |
Primary: T is not std::array.
| T | Decayed type. |
|
constexpr |
true when T is exactly std::variant after stripping cv and references.
Specialization for every std::variant alternative list.
| T | Type to test. |
Partial specialization of a variable template — not SFINAE. Needed because there is no standard std::is_variant.
| Ts | Variant alternatives. |
|
constexpr |
Convenience wrapper around StormByte::Type::Detail::variant_has_type_impl.
| VariantT | A std::variant. |
| U | Candidate alternative. |