mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-19 05:10:55 +00:00
chore: Enable modernize-unary-static-assert (#7705)
This commit is contained in:
@@ -80,7 +80,6 @@ Checks: "-*,
|
||||
-modernize-replace-random-shuffle,
|
||||
-modernize-return-braced-init-list,
|
||||
-modernize-shrink-to-fit,
|
||||
-modernize-unary-static-assert,
|
||||
-modernize-use-auto,
|
||||
-modernize-use-bool-literals,
|
||||
-modernize-use-constraints,
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
//
|
||||
|
||||
static constexpr std::size_t kBytes = Bits / 8;
|
||||
static_assert(sizeof(data_) == kBytes, "");
|
||||
static_assert(sizeof(data_) == kBytes);
|
||||
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
|
||||
@@ -108,12 +108,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_copy_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_move_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_copy_assignable_v<Sink>, "");
|
||||
static_assert(!std::is_move_assignable_v<Sink>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Sink>, "");
|
||||
static_assert(!std::is_default_constructible_v<Sink>);
|
||||
static_assert(!std::is_copy_constructible_v<Sink>);
|
||||
static_assert(!std::is_move_constructible_v<Sink>);
|
||||
static_assert(!std::is_copy_assignable_v<Sink>);
|
||||
static_assert(!std::is_move_assignable_v<Sink>);
|
||||
static_assert(std::is_nothrow_destructible_v<Sink>);
|
||||
#endif
|
||||
|
||||
/** Returns a Sink which does nothing. */
|
||||
@@ -164,12 +164,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<ScopedStream>, "");
|
||||
static_assert(std::is_copy_constructible_v<ScopedStream>, "");
|
||||
static_assert(std::is_move_constructible_v<ScopedStream>, "");
|
||||
static_assert(!std::is_copy_assignable_v<ScopedStream>, "");
|
||||
static_assert(!std::is_move_assignable_v<ScopedStream>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<ScopedStream>, "");
|
||||
static_assert(!std::is_default_constructible_v<ScopedStream>);
|
||||
static_assert(std::is_copy_constructible_v<ScopedStream>);
|
||||
static_assert(std::is_move_constructible_v<ScopedStream>);
|
||||
static_assert(!std::is_copy_assignable_v<ScopedStream>);
|
||||
static_assert(!std::is_move_assignable_v<ScopedStream>);
|
||||
static_assert(std::is_nothrow_destructible_v<ScopedStream>);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -246,12 +246,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(std::is_default_constructible_v<Stream>, "");
|
||||
static_assert(std::is_copy_constructible_v<Stream>, "");
|
||||
static_assert(std::is_move_constructible_v<Stream>, "");
|
||||
static_assert(!std::is_copy_assignable_v<Stream>, "");
|
||||
static_assert(!std::is_move_assignable_v<Stream>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Stream>, "");
|
||||
static_assert(std::is_default_constructible_v<Stream>);
|
||||
static_assert(std::is_copy_constructible_v<Stream>);
|
||||
static_assert(std::is_move_constructible_v<Stream>);
|
||||
static_assert(!std::is_copy_assignable_v<Stream>);
|
||||
static_assert(!std::is_move_assignable_v<Stream>);
|
||||
static_assert(std::is_nothrow_destructible_v<Stream>);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -329,12 +329,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<Journal>, "");
|
||||
static_assert(std::is_copy_constructible_v<Journal>, "");
|
||||
static_assert(std::is_move_constructible_v<Journal>, "");
|
||||
static_assert(std::is_copy_assignable_v<Journal>, "");
|
||||
static_assert(std::is_move_assignable_v<Journal>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Journal>, "");
|
||||
static_assert(!std::is_default_constructible_v<Journal>);
|
||||
static_assert(std::is_copy_constructible_v<Journal>);
|
||||
static_assert(std::is_move_constructible_v<Journal>);
|
||||
static_assert(std::is_copy_assignable_v<Journal>);
|
||||
static_assert(std::is_move_assignable_v<Journal>);
|
||||
static_assert(std::is_nothrow_destructible_v<Journal>);
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -141,7 +141,7 @@ template <class Base>
|
||||
class CachedView : public detail::CachedViewImpl
|
||||
{
|
||||
private:
|
||||
static_assert(std::is_base_of_v<DigestAwareReadView, Base>, "");
|
||||
static_assert(std::is_base_of_v<DigestAwareReadView, Base>);
|
||||
|
||||
std::shared_ptr<Base const> sp_;
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ public:
|
||||
std::optional<value_type> mutable cache_;
|
||||
};
|
||||
|
||||
static_assert(std::is_nothrow_move_constructible<Iterator>{}, "");
|
||||
static_assert(std::is_nothrow_move_assignable<Iterator>{}, "");
|
||||
static_assert(std::is_nothrow_move_constructible<Iterator>{});
|
||||
static_assert(std::is_nothrow_move_assignable<Iterator>{});
|
||||
|
||||
using const_iterator = Iterator;
|
||||
|
||||
|
||||
@@ -1241,7 +1241,7 @@ template <typename T, typename V>
|
||||
void
|
||||
STObject::setFieldUsingSetValue(SField const& field, V value)
|
||||
{
|
||||
static_assert(!std::is_lvalue_reference_v<V>, "");
|
||||
static_assert(!std::is_lvalue_reference_v<V>);
|
||||
|
||||
STBase* rf = getPField(field, true);
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
template <int N>
|
||||
explicit SerialIter(std::uint8_t const (&data)[N]) : SerialIter(&data[0], N)
|
||||
{
|
||||
static_assert(N > 0, "");
|
||||
static_assert(N > 0);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool
|
||||
|
||||
@@ -444,7 +444,7 @@ template <class T>
|
||||
T
|
||||
SerialIter::getRawHelper(int size)
|
||||
{
|
||||
static_assert(std::is_same_v<T, Blob> || std::is_same_v<T, Buffer>, "");
|
||||
static_assert(std::is_same_v<T, Blob> || std::is_same_v<T, Buffer>);
|
||||
if (remain_ < size)
|
||||
Throw<std::runtime_error>("invalid SerialIter getRaw");
|
||||
T result(size);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace xrpl {
|
||||
|
||||
OpensslRipemd160Hasher::OpensslRipemd160Hasher()
|
||||
{
|
||||
static_assert(sizeof(decltype(OpensslRipemd160Hasher::ctx_)) == sizeof(RIPEMD160_CTX), "");
|
||||
static_assert(sizeof(decltype(OpensslRipemd160Hasher::ctx_)) == sizeof(RIPEMD160_CTX));
|
||||
auto const ctx = reinterpret_cast<RIPEMD160_CTX*>(ctx_);
|
||||
RIPEMD160_Init(ctx);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ operator result_type() noexcept
|
||||
|
||||
OpensslSha512Hasher::OpensslSha512Hasher()
|
||||
{
|
||||
static_assert(sizeof(decltype(OpensslSha512Hasher::ctx_)) == sizeof(SHA512_CTX), "");
|
||||
static_assert(sizeof(decltype(OpensslSha512Hasher::ctx_)) == sizeof(SHA512_CTX));
|
||||
auto const ctx = reinterpret_cast<SHA512_CTX*>(ctx_);
|
||||
SHA512_Init(ctx);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ operator result_type() noexcept
|
||||
|
||||
OpensslSha256Hasher::OpensslSha256Hasher()
|
||||
{
|
||||
static_assert(sizeof(decltype(OpensslSha256Hasher::ctx_)) == sizeof(SHA256_CTX), "");
|
||||
static_assert(sizeof(decltype(OpensslSha256Hasher::ctx_)) == sizeof(SHA256_CTX));
|
||||
auto const ctx = reinterpret_cast<SHA256_CTX*>(ctx_);
|
||||
SHA256_Init(ctx);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class ElementComboIter
|
||||
};
|
||||
|
||||
std::uint16_t state_ = 0;
|
||||
static_assert(safeCast<size_t>(SB::Last) <= sizeof(decltype(state_)) * 8, "");
|
||||
static_assert(safeCast<size_t>(SB::Last) <= sizeof(decltype(state_)) * 8);
|
||||
STPathElement const* prev_ = nullptr;
|
||||
// disallow iss and cur to be specified with acc is specified (simplifies
|
||||
// some tests)
|
||||
|
||||
@@ -103,8 +103,8 @@ struct Buffer_test : beast::unit_test::Suite
|
||||
{
|
||||
testcase("Move Construction / Assignment");
|
||||
|
||||
static_assert(std::is_nothrow_move_constructible_v<Buffer>, "");
|
||||
static_assert(std::is_nothrow_move_assignable_v<Buffer>, "");
|
||||
static_assert(std::is_nothrow_move_constructible_v<Buffer>);
|
||||
static_assert(std::is_nothrow_move_assignable_v<Buffer>);
|
||||
|
||||
{ // Move-construct from empty buf
|
||||
Buffer x;
|
||||
|
||||
@@ -110,10 +110,10 @@ public:
|
||||
PrettyAmount(0u); // NOLINT(bugprone-unused-raii)
|
||||
PrettyAmount(1u); // NOLINT(bugprone-unused-raii)
|
||||
PrettyAmount(-1); // NOLINT(bugprone-unused-raii)
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, char>, "");
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, unsigned char>, "");
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, short>, "");
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, unsigned short>, "");
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, char>);
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, unsigned char>);
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, short>);
|
||||
static_assert(!std::is_trivially_constructible_v<PrettyAmount, unsigned short>);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
static STAmount
|
||||
amount(Integer integer, std::enable_if_t<std::is_signed_v<Integer>>* = 0)
|
||||
{
|
||||
static_assert(std::is_integral_v<Integer>, "");
|
||||
static_assert(std::is_integral_v<Integer>);
|
||||
return STAmount(integer, false);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
static STAmount
|
||||
amount(Integer integer, std::enable_if_t<!std::is_signed_v<Integer>>* = 0)
|
||||
{
|
||||
static_assert(std::is_integral_v<Integer>, "");
|
||||
static_assert(std::is_integral_v<Integer>);
|
||||
if (integer < 0)
|
||||
return STAmount(-integer, true);
|
||||
return STAmount(integer, false);
|
||||
|
||||
@@ -356,8 +356,7 @@ public:
|
||||
{
|
||||
STObject st(sfGeneric);
|
||||
auto const v = ~st[~sf1Outer];
|
||||
static_assert(
|
||||
std::is_same_v<std::decay_t<decltype(v)>, std::optional<std::uint32_t>>, "");
|
||||
static_assert(std::is_same_v<std::decay_t<decltype(v)>, std::optional<std::uint32_t>>);
|
||||
}
|
||||
|
||||
// UDT scalar fields
|
||||
@@ -431,8 +430,7 @@ public:
|
||||
BEAST_EXPECT(cst[~sf]->size() == 2); // NOLINT(bugprone-unchecked-optional-access)
|
||||
BEAST_EXPECT(cst[sf][0] == 1);
|
||||
BEAST_EXPECT(cst[sf][1] == 2);
|
||||
static_assert(
|
||||
std::is_same_v<decltype(cst[sfIndexes]), std::vector<uint256> const&>, "");
|
||||
static_assert(std::is_same_v<decltype(cst[sfIndexes]), std::vector<uint256> const&>);
|
||||
}
|
||||
|
||||
// Default by reference field
|
||||
|
||||
@@ -81,128 +81,128 @@ struct SeqProxy_test : public beast::unit_test::Suite
|
||||
static constexpr SeqProxy kTicBig{kTicket, kUintMax};
|
||||
|
||||
// Verify operation of value(), isSeq() and isTicket().
|
||||
static_assert(expectValues(kSeqZero, 0, kSeq), "");
|
||||
static_assert(expectValues(kSeqSmall, 1, kSeq), "");
|
||||
static_assert(expectValues(kSeqMiD0, 2, kSeq), "");
|
||||
static_assert(expectValues(kSeqMiD1, 2, kSeq), "");
|
||||
static_assert(expectValues(kSeqBig, kUintMax, kSeq), "");
|
||||
static_assert(expectValues(kSeqZero, 0, kSeq));
|
||||
static_assert(expectValues(kSeqSmall, 1, kSeq));
|
||||
static_assert(expectValues(kSeqMiD0, 2, kSeq));
|
||||
static_assert(expectValues(kSeqMiD1, 2, kSeq));
|
||||
static_assert(expectValues(kSeqBig, kUintMax, kSeq));
|
||||
|
||||
static_assert(expectValues(kTicZero, 0, kTicket), "");
|
||||
static_assert(expectValues(kTicSmall, 1, kTicket), "");
|
||||
static_assert(expectValues(kTicMid0, 2, kTicket), "");
|
||||
static_assert(expectValues(kTicMid1, 2, kTicket), "");
|
||||
static_assert(expectValues(kTicBig, kUintMax, kTicket), "");
|
||||
static_assert(expectValues(kTicZero, 0, kTicket));
|
||||
static_assert(expectValues(kTicSmall, 1, kTicket));
|
||||
static_assert(expectValues(kTicMid0, 2, kTicket));
|
||||
static_assert(expectValues(kTicMid1, 2, kTicket));
|
||||
static_assert(expectValues(kTicBig, kUintMax, kTicket));
|
||||
|
||||
// Verify expected behavior of comparison operators.
|
||||
static_assert(expectEq(kSeqZero, kSeqZero), "");
|
||||
static_assert(expectLt(kSeqZero, kSeqSmall), "");
|
||||
static_assert(expectLt(kSeqZero, kSeqMiD0), "");
|
||||
static_assert(expectLt(kSeqZero, kSeqMiD1), "");
|
||||
static_assert(expectLt(kSeqZero, kSeqBig), "");
|
||||
static_assert(expectLt(kSeqZero, kTicZero), "");
|
||||
static_assert(expectLt(kSeqZero, kTicSmall), "");
|
||||
static_assert(expectLt(kSeqZero, kTicMid0), "");
|
||||
static_assert(expectLt(kSeqZero, kTicMid1), "");
|
||||
static_assert(expectLt(kSeqZero, kTicBig), "");
|
||||
static_assert(expectEq(kSeqZero, kSeqZero));
|
||||
static_assert(expectLt(kSeqZero, kSeqSmall));
|
||||
static_assert(expectLt(kSeqZero, kSeqMiD0));
|
||||
static_assert(expectLt(kSeqZero, kSeqMiD1));
|
||||
static_assert(expectLt(kSeqZero, kSeqBig));
|
||||
static_assert(expectLt(kSeqZero, kTicZero));
|
||||
static_assert(expectLt(kSeqZero, kTicSmall));
|
||||
static_assert(expectLt(kSeqZero, kTicMid0));
|
||||
static_assert(expectLt(kSeqZero, kTicMid1));
|
||||
static_assert(expectLt(kSeqZero, kTicBig));
|
||||
|
||||
static_assert(expectGt(kSeqSmall, kSeqZero), "");
|
||||
static_assert(expectEq(kSeqSmall, kSeqSmall), "");
|
||||
static_assert(expectLt(kSeqSmall, kSeqMiD0), "");
|
||||
static_assert(expectLt(kSeqSmall, kSeqMiD1), "");
|
||||
static_assert(expectLt(kSeqSmall, kSeqBig), "");
|
||||
static_assert(expectLt(kSeqSmall, kTicZero), "");
|
||||
static_assert(expectLt(kSeqSmall, kTicSmall), "");
|
||||
static_assert(expectLt(kSeqSmall, kTicMid0), "");
|
||||
static_assert(expectLt(kSeqSmall, kTicMid1), "");
|
||||
static_assert(expectLt(kSeqSmall, kTicBig), "");
|
||||
static_assert(expectGt(kSeqSmall, kSeqZero));
|
||||
static_assert(expectEq(kSeqSmall, kSeqSmall));
|
||||
static_assert(expectLt(kSeqSmall, kSeqMiD0));
|
||||
static_assert(expectLt(kSeqSmall, kSeqMiD1));
|
||||
static_assert(expectLt(kSeqSmall, kSeqBig));
|
||||
static_assert(expectLt(kSeqSmall, kTicZero));
|
||||
static_assert(expectLt(kSeqSmall, kTicSmall));
|
||||
static_assert(expectLt(kSeqSmall, kTicMid0));
|
||||
static_assert(expectLt(kSeqSmall, kTicMid1));
|
||||
static_assert(expectLt(kSeqSmall, kTicBig));
|
||||
|
||||
static_assert(expectGt(kSeqMiD0, kSeqZero), "");
|
||||
static_assert(expectGt(kSeqMiD0, kSeqSmall), "");
|
||||
static_assert(expectEq(kSeqMiD0, kSeqMiD0), "");
|
||||
static_assert(expectEq(kSeqMiD0, kSeqMiD1), "");
|
||||
static_assert(expectLt(kSeqMiD0, kSeqBig), "");
|
||||
static_assert(expectLt(kSeqMiD0, kTicZero), "");
|
||||
static_assert(expectLt(kSeqMiD0, kTicSmall), "");
|
||||
static_assert(expectLt(kSeqMiD0, kTicMid0), "");
|
||||
static_assert(expectLt(kSeqMiD0, kTicMid1), "");
|
||||
static_assert(expectLt(kSeqMiD0, kTicBig), "");
|
||||
static_assert(expectGt(kSeqMiD0, kSeqZero));
|
||||
static_assert(expectGt(kSeqMiD0, kSeqSmall));
|
||||
static_assert(expectEq(kSeqMiD0, kSeqMiD0));
|
||||
static_assert(expectEq(kSeqMiD0, kSeqMiD1));
|
||||
static_assert(expectLt(kSeqMiD0, kSeqBig));
|
||||
static_assert(expectLt(kSeqMiD0, kTicZero));
|
||||
static_assert(expectLt(kSeqMiD0, kTicSmall));
|
||||
static_assert(expectLt(kSeqMiD0, kTicMid0));
|
||||
static_assert(expectLt(kSeqMiD0, kTicMid1));
|
||||
static_assert(expectLt(kSeqMiD0, kTicBig));
|
||||
|
||||
static_assert(expectGt(kSeqMiD1, kSeqZero), "");
|
||||
static_assert(expectGt(kSeqMiD1, kSeqSmall), "");
|
||||
static_assert(expectEq(kSeqMiD1, kSeqMiD0), "");
|
||||
static_assert(expectEq(kSeqMiD1, kSeqMiD1), "");
|
||||
static_assert(expectLt(kSeqMiD1, kSeqBig), "");
|
||||
static_assert(expectLt(kSeqMiD1, kTicZero), "");
|
||||
static_assert(expectLt(kSeqMiD1, kTicSmall), "");
|
||||
static_assert(expectLt(kSeqMiD1, kTicMid0), "");
|
||||
static_assert(expectLt(kSeqMiD1, kTicMid1), "");
|
||||
static_assert(expectLt(kSeqMiD1, kTicBig), "");
|
||||
static_assert(expectGt(kSeqMiD1, kSeqZero));
|
||||
static_assert(expectGt(kSeqMiD1, kSeqSmall));
|
||||
static_assert(expectEq(kSeqMiD1, kSeqMiD0));
|
||||
static_assert(expectEq(kSeqMiD1, kSeqMiD1));
|
||||
static_assert(expectLt(kSeqMiD1, kSeqBig));
|
||||
static_assert(expectLt(kSeqMiD1, kTicZero));
|
||||
static_assert(expectLt(kSeqMiD1, kTicSmall));
|
||||
static_assert(expectLt(kSeqMiD1, kTicMid0));
|
||||
static_assert(expectLt(kSeqMiD1, kTicMid1));
|
||||
static_assert(expectLt(kSeqMiD1, kTicBig));
|
||||
|
||||
static_assert(expectGt(kSeqBig, kSeqZero), "");
|
||||
static_assert(expectGt(kSeqBig, kSeqSmall), "");
|
||||
static_assert(expectGt(kSeqBig, kSeqMiD0), "");
|
||||
static_assert(expectGt(kSeqBig, kSeqMiD1), "");
|
||||
static_assert(expectEq(kSeqBig, kSeqBig), "");
|
||||
static_assert(expectLt(kSeqBig, kTicZero), "");
|
||||
static_assert(expectLt(kSeqBig, kTicSmall), "");
|
||||
static_assert(expectLt(kSeqBig, kTicMid0), "");
|
||||
static_assert(expectLt(kSeqBig, kTicMid1), "");
|
||||
static_assert(expectLt(kSeqBig, kTicBig), "");
|
||||
static_assert(expectGt(kSeqBig, kSeqZero));
|
||||
static_assert(expectGt(kSeqBig, kSeqSmall));
|
||||
static_assert(expectGt(kSeqBig, kSeqMiD0));
|
||||
static_assert(expectGt(kSeqBig, kSeqMiD1));
|
||||
static_assert(expectEq(kSeqBig, kSeqBig));
|
||||
static_assert(expectLt(kSeqBig, kTicZero));
|
||||
static_assert(expectLt(kSeqBig, kTicSmall));
|
||||
static_assert(expectLt(kSeqBig, kTicMid0));
|
||||
static_assert(expectLt(kSeqBig, kTicMid1));
|
||||
static_assert(expectLt(kSeqBig, kTicBig));
|
||||
|
||||
static_assert(expectGt(kTicZero, kSeqZero), "");
|
||||
static_assert(expectGt(kTicZero, kSeqSmall), "");
|
||||
static_assert(expectGt(kTicZero, kSeqMiD0), "");
|
||||
static_assert(expectGt(kTicZero, kSeqMiD1), "");
|
||||
static_assert(expectGt(kTicZero, kSeqBig), "");
|
||||
static_assert(expectEq(kTicZero, kTicZero), "");
|
||||
static_assert(expectLt(kTicZero, kTicSmall), "");
|
||||
static_assert(expectLt(kTicZero, kTicMid0), "");
|
||||
static_assert(expectLt(kTicZero, kTicMid1), "");
|
||||
static_assert(expectLt(kTicZero, kTicBig), "");
|
||||
static_assert(expectGt(kTicZero, kSeqZero));
|
||||
static_assert(expectGt(kTicZero, kSeqSmall));
|
||||
static_assert(expectGt(kTicZero, kSeqMiD0));
|
||||
static_assert(expectGt(kTicZero, kSeqMiD1));
|
||||
static_assert(expectGt(kTicZero, kSeqBig));
|
||||
static_assert(expectEq(kTicZero, kTicZero));
|
||||
static_assert(expectLt(kTicZero, kTicSmall));
|
||||
static_assert(expectLt(kTicZero, kTicMid0));
|
||||
static_assert(expectLt(kTicZero, kTicMid1));
|
||||
static_assert(expectLt(kTicZero, kTicBig));
|
||||
|
||||
static_assert(expectGt(kTicSmall, kSeqZero), "");
|
||||
static_assert(expectGt(kTicSmall, kSeqSmall), "");
|
||||
static_assert(expectGt(kTicSmall, kSeqMiD0), "");
|
||||
static_assert(expectGt(kTicSmall, kSeqMiD1), "");
|
||||
static_assert(expectGt(kTicSmall, kSeqBig), "");
|
||||
static_assert(expectGt(kTicSmall, kTicZero), "");
|
||||
static_assert(expectEq(kTicSmall, kTicSmall), "");
|
||||
static_assert(expectLt(kTicSmall, kTicMid0), "");
|
||||
static_assert(expectLt(kTicSmall, kTicMid1), "");
|
||||
static_assert(expectLt(kTicSmall, kTicBig), "");
|
||||
static_assert(expectGt(kTicSmall, kSeqZero));
|
||||
static_assert(expectGt(kTicSmall, kSeqSmall));
|
||||
static_assert(expectGt(kTicSmall, kSeqMiD0));
|
||||
static_assert(expectGt(kTicSmall, kSeqMiD1));
|
||||
static_assert(expectGt(kTicSmall, kSeqBig));
|
||||
static_assert(expectGt(kTicSmall, kTicZero));
|
||||
static_assert(expectEq(kTicSmall, kTicSmall));
|
||||
static_assert(expectLt(kTicSmall, kTicMid0));
|
||||
static_assert(expectLt(kTicSmall, kTicMid1));
|
||||
static_assert(expectLt(kTicSmall, kTicBig));
|
||||
|
||||
static_assert(expectGt(kTicMid0, kSeqZero), "");
|
||||
static_assert(expectGt(kTicMid0, kSeqSmall), "");
|
||||
static_assert(expectGt(kTicMid0, kSeqMiD0), "");
|
||||
static_assert(expectGt(kTicMid0, kSeqMiD1), "");
|
||||
static_assert(expectGt(kTicMid0, kSeqBig), "");
|
||||
static_assert(expectGt(kTicMid0, kTicZero), "");
|
||||
static_assert(expectGt(kTicMid0, kTicSmall), "");
|
||||
static_assert(expectEq(kTicMid0, kTicMid0), "");
|
||||
static_assert(expectEq(kTicMid0, kTicMid1), "");
|
||||
static_assert(expectLt(kTicMid0, kTicBig), "");
|
||||
static_assert(expectGt(kTicMid0, kSeqZero));
|
||||
static_assert(expectGt(kTicMid0, kSeqSmall));
|
||||
static_assert(expectGt(kTicMid0, kSeqMiD0));
|
||||
static_assert(expectGt(kTicMid0, kSeqMiD1));
|
||||
static_assert(expectGt(kTicMid0, kSeqBig));
|
||||
static_assert(expectGt(kTicMid0, kTicZero));
|
||||
static_assert(expectGt(kTicMid0, kTicSmall));
|
||||
static_assert(expectEq(kTicMid0, kTicMid0));
|
||||
static_assert(expectEq(kTicMid0, kTicMid1));
|
||||
static_assert(expectLt(kTicMid0, kTicBig));
|
||||
|
||||
static_assert(expectGt(kTicMid1, kSeqZero), "");
|
||||
static_assert(expectGt(kTicMid1, kSeqSmall), "");
|
||||
static_assert(expectGt(kTicMid1, kSeqMiD0), "");
|
||||
static_assert(expectGt(kTicMid1, kSeqMiD1), "");
|
||||
static_assert(expectGt(kTicMid1, kSeqBig), "");
|
||||
static_assert(expectGt(kTicMid1, kTicZero), "");
|
||||
static_assert(expectGt(kTicMid1, kTicSmall), "");
|
||||
static_assert(expectEq(kTicMid1, kTicMid0), "");
|
||||
static_assert(expectEq(kTicMid1, kTicMid1), "");
|
||||
static_assert(expectLt(kTicMid1, kTicBig), "");
|
||||
static_assert(expectGt(kTicMid1, kSeqZero));
|
||||
static_assert(expectGt(kTicMid1, kSeqSmall));
|
||||
static_assert(expectGt(kTicMid1, kSeqMiD0));
|
||||
static_assert(expectGt(kTicMid1, kSeqMiD1));
|
||||
static_assert(expectGt(kTicMid1, kSeqBig));
|
||||
static_assert(expectGt(kTicMid1, kTicZero));
|
||||
static_assert(expectGt(kTicMid1, kTicSmall));
|
||||
static_assert(expectEq(kTicMid1, kTicMid0));
|
||||
static_assert(expectEq(kTicMid1, kTicMid1));
|
||||
static_assert(expectLt(kTicMid1, kTicBig));
|
||||
|
||||
static_assert(expectGt(kTicBig, kSeqZero), "");
|
||||
static_assert(expectGt(kTicBig, kSeqSmall), "");
|
||||
static_assert(expectGt(kTicBig, kSeqMiD0), "");
|
||||
static_assert(expectGt(kTicBig, kSeqMiD1), "");
|
||||
static_assert(expectGt(kTicBig, kSeqBig), "");
|
||||
static_assert(expectGt(kTicBig, kTicZero), "");
|
||||
static_assert(expectGt(kTicBig, kTicSmall), "");
|
||||
static_assert(expectGt(kTicBig, kTicMid0), "");
|
||||
static_assert(expectGt(kTicBig, kTicMid1), "");
|
||||
static_assert(expectEq(kTicBig, kTicBig), "");
|
||||
static_assert(expectGt(kTicBig, kSeqZero));
|
||||
static_assert(expectGt(kTicBig, kSeqSmall));
|
||||
static_assert(expectGt(kTicBig, kSeqMiD0));
|
||||
static_assert(expectGt(kTicBig, kSeqMiD1));
|
||||
static_assert(expectGt(kTicBig, kSeqBig));
|
||||
static_assert(expectGt(kTicBig, kTicZero));
|
||||
static_assert(expectGt(kTicBig, kTicSmall));
|
||||
static_assert(expectGt(kTicBig, kTicMid0));
|
||||
static_assert(expectGt(kTicBig, kTicMid1));
|
||||
static_assert(expectEq(kTicBig, kTicBig));
|
||||
|
||||
// Verify streaming.
|
||||
BEAST_EXPECT(streamTest(kSeqZero));
|
||||
|
||||
@@ -26,57 +26,57 @@
|
||||
namespace xrpl::tests {
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(std::is_nothrow_destructible<SHAMap>{}, "");
|
||||
static_assert(!std::is_default_constructible<SHAMap>{}, "");
|
||||
static_assert(!std::is_copy_constructible<SHAMap>{}, "");
|
||||
static_assert(!std::is_copy_assignable<SHAMap>{}, "");
|
||||
static_assert(!std::is_move_constructible<SHAMap>{}, "");
|
||||
static_assert(!std::is_move_assignable<SHAMap>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMap>{});
|
||||
static_assert(!std::is_default_constructible<SHAMap>{});
|
||||
static_assert(!std::is_copy_constructible<SHAMap>{});
|
||||
static_assert(!std::is_copy_assignable<SHAMap>{});
|
||||
static_assert(!std::is_move_constructible<SHAMap>{});
|
||||
static_assert(!std::is_move_assignable<SHAMap>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMap::ConstIterator>{}, "");
|
||||
static_assert(std::is_copy_constructible<SHAMap::ConstIterator>{}, "");
|
||||
static_assert(std::is_copy_assignable<SHAMap::ConstIterator>{}, "");
|
||||
static_assert(std::is_move_constructible<SHAMap::ConstIterator>{}, "");
|
||||
static_assert(std::is_move_assignable<SHAMap::ConstIterator>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMap::ConstIterator>{});
|
||||
static_assert(std::is_copy_constructible<SHAMap::ConstIterator>{});
|
||||
static_assert(std::is_copy_assignable<SHAMap::ConstIterator>{});
|
||||
static_assert(std::is_move_constructible<SHAMap::ConstIterator>{});
|
||||
static_assert(std::is_move_assignable<SHAMap::ConstIterator>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapItem>{}, "");
|
||||
static_assert(!std::is_default_constructible<SHAMapItem>{}, "");
|
||||
static_assert(!std::is_copy_constructible<SHAMapItem>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapItem>{});
|
||||
static_assert(!std::is_default_constructible<SHAMapItem>{});
|
||||
static_assert(!std::is_copy_constructible<SHAMapItem>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_default_constructible<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_copy_constructible<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_copy_assignable<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_move_constructible<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_move_assignable<SHAMapNodeID>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapNodeID>{});
|
||||
static_assert(std::is_default_constructible<SHAMapNodeID>{});
|
||||
static_assert(std::is_copy_constructible<SHAMapNodeID>{});
|
||||
static_assert(std::is_copy_assignable<SHAMapNodeID>{});
|
||||
static_assert(std::is_move_constructible<SHAMapNodeID>{});
|
||||
static_assert(std::is_move_assignable<SHAMapNodeID>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapHash>{}, "");
|
||||
static_assert(std::is_default_constructible<SHAMapHash>{}, "");
|
||||
static_assert(std::is_copy_constructible<SHAMapHash>{}, "");
|
||||
static_assert(std::is_copy_assignable<SHAMapHash>{}, "");
|
||||
static_assert(std::is_move_constructible<SHAMapHash>{}, "");
|
||||
static_assert(std::is_move_assignable<SHAMapHash>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapHash>{});
|
||||
static_assert(std::is_default_constructible<SHAMapHash>{});
|
||||
static_assert(std::is_copy_constructible<SHAMapHash>{});
|
||||
static_assert(std::is_copy_assignable<SHAMapHash>{});
|
||||
static_assert(std::is_move_constructible<SHAMapHash>{});
|
||||
static_assert(std::is_move_assignable<SHAMapHash>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapTreeNode>{}, "");
|
||||
static_assert(!std::is_default_constructible<SHAMapTreeNode>{}, "");
|
||||
static_assert(!std::is_copy_constructible<SHAMapTreeNode>{}, "");
|
||||
static_assert(!std::is_copy_assignable<SHAMapTreeNode>{}, "");
|
||||
static_assert(!std::is_move_constructible<SHAMapTreeNode>{}, "");
|
||||
static_assert(!std::is_move_assignable<SHAMapTreeNode>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapTreeNode>{});
|
||||
static_assert(!std::is_default_constructible<SHAMapTreeNode>{});
|
||||
static_assert(!std::is_copy_constructible<SHAMapTreeNode>{});
|
||||
static_assert(!std::is_copy_assignable<SHAMapTreeNode>{});
|
||||
static_assert(!std::is_move_constructible<SHAMapTreeNode>{});
|
||||
static_assert(!std::is_move_assignable<SHAMapTreeNode>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapInnerNode>{}, "");
|
||||
static_assert(!std::is_default_constructible<SHAMapInnerNode>{}, "");
|
||||
static_assert(!std::is_copy_constructible<SHAMapInnerNode>{}, "");
|
||||
static_assert(!std::is_copy_assignable<SHAMapInnerNode>{}, "");
|
||||
static_assert(!std::is_move_constructible<SHAMapInnerNode>{}, "");
|
||||
static_assert(!std::is_move_assignable<SHAMapInnerNode>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapInnerNode>{});
|
||||
static_assert(!std::is_default_constructible<SHAMapInnerNode>{});
|
||||
static_assert(!std::is_copy_constructible<SHAMapInnerNode>{});
|
||||
static_assert(!std::is_copy_assignable<SHAMapInnerNode>{});
|
||||
static_assert(!std::is_move_constructible<SHAMapInnerNode>{});
|
||||
static_assert(!std::is_move_assignable<SHAMapInnerNode>{});
|
||||
|
||||
static_assert(std::is_nothrow_destructible<SHAMapLeafNode>{}, "");
|
||||
static_assert(!std::is_default_constructible<SHAMapLeafNode>{}, "");
|
||||
static_assert(!std::is_copy_constructible<SHAMapLeafNode>{}, "");
|
||||
static_assert(!std::is_copy_assignable<SHAMapLeafNode>{}, "");
|
||||
static_assert(!std::is_move_constructible<SHAMapLeafNode>{}, "");
|
||||
static_assert(!std::is_move_assignable<SHAMapLeafNode>{}, "");
|
||||
static_assert(std::is_nothrow_destructible<SHAMapLeafNode>{});
|
||||
static_assert(!std::is_default_constructible<SHAMapLeafNode>{});
|
||||
static_assert(!std::is_copy_constructible<SHAMapLeafNode>{});
|
||||
static_assert(!std::is_copy_assignable<SHAMapLeafNode>{});
|
||||
static_assert(!std::is_move_constructible<SHAMapLeafNode>{});
|
||||
static_assert(!std::is_move_assignable<SHAMapLeafNode>{});
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
|
||||
@@ -228,11 +228,11 @@ static_assert(sumOfFirstSquares(1).second == 1);
|
||||
static_assert(sumOfFirstSquares(2).first);
|
||||
static_assert(sumOfFirstSquares(2).second == 5);
|
||||
|
||||
static_assert(sumOfFirstSquares(0x1FFFFF).first, "");
|
||||
static_assert(sumOfFirstSquares(0x1FFFFF).second == 0x2AAAA8AAAAB00000ul, "");
|
||||
static_assert(sumOfFirstSquares(0x1FFFFF).first);
|
||||
static_assert(sumOfFirstSquares(0x1FFFFF).second == 0x2AAAA8AAAAB00000ul);
|
||||
|
||||
static_assert(!sumOfFirstSquares(0x200000).first, "");
|
||||
static_assert(sumOfFirstSquares(0x200000).second == std::numeric_limits<std::uint64_t>::max(), "");
|
||||
static_assert(!sumOfFirstSquares(0x200000).first);
|
||||
static_assert(sumOfFirstSquares(0x200000).second == std::numeric_limits<std::uint64_t>::max());
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
Reference in New Issue
Block a user