12 #include <scale/scale.hpp> 16 template <
typename T,
typename = std::enable_if<std::is_scalar_v<T>>>
18 template <
typename... Args>
28 std::conditional_t<std::is_scalar_v<T>,
Wrapper<T>, T>>
33 template <
typename... Args>
34 explicit Tagged(Args &&...args) : Base(
std::forward<Args>(args)...) {}
40 not
std::is_lvalue_reference_v<decltype(
value)>) {
41 if constexpr (std::is_scalar_v<T>) {
44 static_cast<Base &
>(*this) = std::forward<T>(
value);
49 template <
typename Out>
50 explicit operator Out() {
51 if constexpr (std::is_scalar_v<T>) {
61 if constexpr (std::is_scalar_v<T>) {
62 return s << tagged.Wrapper<T>
::value;
64 return s << static_cast<const T &>(tagged);
70 if constexpr (std::is_scalar_v<T>) {
71 return s >> tagged.Wrapper<T>
::value;
73 return s >>
static_cast<T &
>(tagged);
80 #endif // KAGOME_TAGGED Tagged(T &&value) noexcept(not std::is_lvalue_reference_v< decltype(value)>)
Tagged & operator=(T &&value) noexcept(not std::is_lvalue_reference_v< decltype(value)>)
friend::scale::ScaleDecoderStream & operator>>(::scale::ScaleDecoderStream &s, Tagged< T, Tag > &tagged)
friend::scale::ScaleEncoderStream & operator<<(::scale::ScaleEncoderStream &s, const Tagged< T, Tag > &tagged)