ark::serialization::IndexedVariant
Defined in header “ark/serialization/indexed_variant.hh”.
A simple class used to assist in rbuf serialization/deserialization of variants with custom index definitions.
Methods
-
constexpr IndexedVariant(const std::variant< Types… > & wrapped, const std::array< uint8_t, sizeof…(Types)> & index)
Constructor. Wraps the given variant, and takes in a reference to the array of indexes. -
constexpr uint8_t user_index()
Returns the user-defined index that is active for this variant. -
size_t variant_index(uint8_t user_index)
Returns the variant index that is active for this variant, based on the given user index. -
constexpr std::variant< Types… > & operator*()
Returns the actual variant that we are wrapping. -
constexpr const std::variant< Types… > & operator*()
Returns the actual variant that we are wrapping. -
IndexedVariant< Types… > & self()
Returns an l-value to ourself.