@@ -220,13 +220,13 @@ const Out& AsBase(const In& x)
220220 template <typename Stream> \
221221 void Serialize (Stream& s) const \
222222 { \
223- static_assert (std::is_same <const cls&, decltype (*this )>::value , " Serialize type mismatch" ); \
223+ static_assert (std::is_same_v <const cls&, decltype (*this )>, " Serialize type mismatch" ); \
224224 Ser (s, *this ); \
225225 } \
226226 template <typename Stream> \
227227 void Unserialize (Stream& s) \
228228 { \
229- static_assert (std::is_same <cls&, decltype (*this )>::value , " Unserialize type mismatch" ); \
229+ static_assert (std::is_same_v <cls&, decltype (*this )>, " Unserialize type mismatch" ); \
230230 Unser (s, *this ); \
231231 }
232232
@@ -408,8 +408,8 @@ template <VarIntMode Mode, typename I>
408408struct CheckVarIntMode {
409409 constexpr CheckVarIntMode ()
410410 {
411- static_assert (Mode != VarIntMode::DEFAULT || std::is_unsigned <I>::value , " Unsigned type required with mode DEFAULT." );
412- static_assert (Mode != VarIntMode::NONNEGATIVE_SIGNED || std::is_signed <I>::value , " Signed type required with mode NONNEGATIVE_SIGNED." );
411+ static_assert (Mode != VarIntMode::DEFAULT || std::is_unsigned_v <I>, " Unsigned type required with mode DEFAULT." );
412+ static_assert (Mode != VarIntMode::NONNEGATIVE_SIGNED || std::is_signed_v <I>, " Signed type required with mode NONNEGATIVE_SIGNED." );
413413 }
414414};
415415
@@ -474,7 +474,7 @@ I ReadVarInt(Stream& is)
474474template <typename Formatter, typename T>
475475class Wrapper
476476{
477- static_assert (std::is_lvalue_reference <T>::value , " Wrapper needs an lvalue reference type T" );
477+ static_assert (std::is_lvalue_reference_v <T>, " Wrapper needs an lvalue reference type T" );
478478protected:
479479 T m_object;
480480public:
@@ -545,7 +545,7 @@ struct CustomUintFormatter
545545
546546 template <typename Stream, typename I> void Unser (Stream& s, I& v)
547547 {
548- using U = typename std::conditional<std::is_enum <I>::value , std::underlying_type<I>, std::common_type<I>>::type::type;
548+ using U = typename std::conditional<std::is_enum_v <I>, std::underlying_type<I>, std::common_type<I>>::type::type;
549549 static_assert (std::numeric_limits<U>::max () >= MAX && std::numeric_limits<U>::min () <= 0 , " Assigned type too small" );
550550 uint64_t raw = 0 ;
551551 if (BigEndian) {
@@ -577,7 +577,7 @@ struct CompactSizeFormatter
577577 template <typename Stream, typename I>
578578 void Ser (Stream& s, I v)
579579 {
580- static_assert (std::is_unsigned <I>::value , " CompactSize only supported for unsigned integers" );
580+ static_assert (std::is_unsigned_v <I>, " CompactSize only supported for unsigned integers" );
581581 static_assert (std::numeric_limits<I>::max () <= std::numeric_limits<uint64_t >::max (), " CompactSize only supports 64-bit integers and below" );
582582
583583 WriteCompactSize<Stream>(s, v);
0 commit comments