1 #ifndef ZSERIO_GENERIC_ACCESSOR_INC_H
2 #define ZSERIO_GENERIC_ACCESSOR_INC_H
14 template <
typename T,
typename =
void>
15 struct generic_accessor;
18 struct generic_accessor<T,
std::enable_if_t<std::is_enum_v<T>>>
24 struct generic_accessor<T,
std::enable_if_t<is_bitmask_v<T>>>
26 using type =
typename T::Values;
29 template <
typename T,
typename U>
30 void setGenericOffset(T& offsetField, U bytesOffset)
32 offsetField =
static_cast<typename T::ValueType
>(bytesOffset);
46 template <
typename ALLOC,
typename T>
49 return optionalValue.
value();
64 template <
typename ALLOC,
typename T>
67 return optionalValue.
value();
constexpr const T & value() const noexcept
const T & genericAccessor(const T &value)
typename detail::generic_accessor< T >::type generic_accessor_t