mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 01:15:53 +00:00
Reformat code with clang-format-18
This commit is contained in:
@@ -136,44 +136,49 @@ class [[nodiscard]] Expected
|
||||
|
||||
public:
|
||||
template <typename U>
|
||||
requires std::convertible_to<U, T> constexpr Expected(U && r)
|
||||
: Base(T(std::forward<U>(r)))
|
||||
requires std::convertible_to<U, T>
|
||||
constexpr Expected(U&& r) : Base(T(std::forward<U>(r)))
|
||||
{
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
requires std::convertible_to<U, E> &&
|
||||
(!std::is_reference_v<U>)constexpr Expected(Unexpected<U> e)
|
||||
: Base(E(std::move(e.value())))
|
||||
requires std::convertible_to<U, E> && (!std::is_reference_v<U>)
|
||||
constexpr Expected(Unexpected<U> e) : Base(E(std::move(e.value())))
|
||||
{
|
||||
}
|
||||
|
||||
constexpr bool has_value() const
|
||||
constexpr bool
|
||||
has_value() const
|
||||
{
|
||||
return Base::has_value();
|
||||
}
|
||||
|
||||
constexpr T const& value() const
|
||||
constexpr T const&
|
||||
value() const
|
||||
{
|
||||
return Base::value();
|
||||
}
|
||||
|
||||
constexpr T& value()
|
||||
constexpr T&
|
||||
value()
|
||||
{
|
||||
return Base::value();
|
||||
}
|
||||
|
||||
constexpr E const& error() const
|
||||
constexpr E const&
|
||||
error() const
|
||||
{
|
||||
return Base::error();
|
||||
}
|
||||
|
||||
constexpr E& error()
|
||||
constexpr E&
|
||||
error()
|
||||
{
|
||||
return Base::error();
|
||||
}
|
||||
|
||||
constexpr explicit operator bool() const
|
||||
constexpr explicit
|
||||
operator bool() const
|
||||
{
|
||||
return has_value();
|
||||
}
|
||||
@@ -181,22 +186,26 @@ public:
|
||||
// Add operator* and operator-> so the Expected API looks a bit more like
|
||||
// what std::expected is likely to look like. See:
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0323r10.html
|
||||
[[nodiscard]] constexpr T& operator*()
|
||||
[[nodiscard]] constexpr T&
|
||||
operator*()
|
||||
{
|
||||
return this->value();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr T const& operator*() const
|
||||
[[nodiscard]] constexpr T const&
|
||||
operator*() const
|
||||
{
|
||||
return this->value();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr T* operator->()
|
||||
[[nodiscard]] constexpr T*
|
||||
operator->()
|
||||
{
|
||||
return &this->value();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr T const* operator->() const
|
||||
[[nodiscard]] constexpr T const*
|
||||
operator->() const
|
||||
{
|
||||
return &this->value();
|
||||
}
|
||||
@@ -218,23 +227,25 @@ public:
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
requires std::convertible_to<U, E> &&
|
||||
(!std::is_reference_v<U>)constexpr Expected(Unexpected<U> e)
|
||||
: Base(E(std::move(e.value())))
|
||||
requires std::convertible_to<U, E> && (!std::is_reference_v<U>)
|
||||
constexpr Expected(Unexpected<U> e) : Base(E(std::move(e.value())))
|
||||
{
|
||||
}
|
||||
|
||||
constexpr E const& error() const
|
||||
constexpr E const&
|
||||
error() const
|
||||
{
|
||||
return Base::error();
|
||||
}
|
||||
|
||||
constexpr E& error()
|
||||
constexpr E&
|
||||
error()
|
||||
{
|
||||
return Base::error();
|
||||
}
|
||||
|
||||
constexpr explicit operator bool() const
|
||||
constexpr explicit
|
||||
operator bool() const
|
||||
{
|
||||
return Base::has_value();
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ private:
|
||||
protected:
|
||||
template <class Other>
|
||||
static constexpr bool is_compatible_v =
|
||||
std::is_arithmetic_v<Other>&& std::is_arithmetic_v<value_type>&&
|
||||
std::is_convertible_v<Other, value_type>;
|
||||
std::is_arithmetic_v<Other> && std::is_arithmetic_v<value_type> &&
|
||||
std::is_convertible_v<Other, value_type>;
|
||||
|
||||
template <class OtherFee, class = enable_if_unit_t<OtherFee>>
|
||||
static constexpr bool is_compatiblefee_v =
|
||||
is_compatible_v<typename OtherFee::value_type>&&
|
||||
std::is_same_v<UnitTag, typename OtherFee::unit_type>;
|
||||
is_compatible_v<typename OtherFee::value_type> &&
|
||||
std::is_same_v<UnitTag, typename OtherFee::unit_type>;
|
||||
|
||||
template <class Other>
|
||||
using enable_if_compatible_t =
|
||||
@@ -110,7 +110,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
constexpr TaggedFee& operator=(beast::Zero)
|
||||
constexpr TaggedFee&
|
||||
operator=(beast::Zero)
|
||||
{
|
||||
fee_ = 0;
|
||||
return *this;
|
||||
@@ -250,7 +251,8 @@ public:
|
||||
}
|
||||
|
||||
/** Returns true if the amount is not zero */
|
||||
explicit constexpr operator bool() const noexcept
|
||||
explicit constexpr
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return fee_ != 0;
|
||||
}
|
||||
@@ -344,8 +346,8 @@ constexpr bool can_muldiv_source_v =
|
||||
|
||||
template <class Dest, class = enable_if_unit_t<Dest>>
|
||||
constexpr bool can_muldiv_dest_v =
|
||||
can_muldiv_source_v<Dest>&& // Dest is also a source
|
||||
std::is_convertible_v<std::uint64_t, typename Dest::value_type> &&
|
||||
can_muldiv_source_v<Dest> && // Dest is also a source
|
||||
std::is_convertible_v<std::uint64_t, typename Dest::value_type> &&
|
||||
sizeof(typename Dest::value_type) >= sizeof(std::uint64_t);
|
||||
|
||||
template <
|
||||
@@ -354,8 +356,8 @@ template <
|
||||
class = enable_if_unit_t<Source1>,
|
||||
class = enable_if_unit_t<Source2>>
|
||||
constexpr bool can_muldiv_sources_v =
|
||||
can_muldiv_source_v<Source1>&& can_muldiv_source_v<Source2>&& std::
|
||||
is_same_v<typename Source1::unit_type, typename Source2::unit_type>;
|
||||
can_muldiv_source_v<Source1> && can_muldiv_source_v<Source2> &&
|
||||
std::is_same_v<typename Source1::unit_type, typename Source2::unit_type>;
|
||||
|
||||
template <
|
||||
class Source1,
|
||||
@@ -365,7 +367,7 @@ template <
|
||||
class = enable_if_unit_t<Source2>,
|
||||
class = enable_if_unit_t<Dest>>
|
||||
constexpr bool can_muldiv_v =
|
||||
can_muldiv_sources_v<Source1, Source2>&& can_muldiv_dest_v<Dest>;
|
||||
can_muldiv_sources_v<Source1, Source2> && can_muldiv_dest_v<Dest>;
|
||||
// Source and Dest can be the same by default
|
||||
|
||||
template <
|
||||
|
||||
@@ -82,7 +82,8 @@ public:
|
||||
operator<(IOUAmount const& other) const;
|
||||
|
||||
/** Returns true if the amount is not zero */
|
||||
explicit operator bool() const noexcept;
|
||||
explicit
|
||||
operator bool() const noexcept;
|
||||
|
||||
/** Return the sign of the amount */
|
||||
int
|
||||
@@ -109,7 +110,8 @@ inline IOUAmount::IOUAmount(std::int64_t mantissa, int exponent)
|
||||
normalize();
|
||||
}
|
||||
|
||||
inline IOUAmount& IOUAmount::operator=(beast::Zero)
|
||||
inline IOUAmount&
|
||||
IOUAmount::operator=(beast::Zero)
|
||||
{
|
||||
// The -100 is used to allow 0 to sort less than small positive values
|
||||
// which will have a large negative exponent.
|
||||
|
||||
@@ -88,8 +88,10 @@ public:
|
||||
static constexpr Number
|
||||
lowest() noexcept;
|
||||
|
||||
explicit operator XRPAmount() const; // round to nearest, even on tie
|
||||
explicit operator rep() const; // round to nearest, even on tie
|
||||
explicit
|
||||
operator XRPAmount() const; // round to nearest, even on tie
|
||||
explicit
|
||||
operator rep() const; // round to nearest, even on tie
|
||||
|
||||
friend constexpr bool
|
||||
operator==(Number const& x, Number const& y) noexcept
|
||||
|
||||
@@ -65,7 +65,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
constexpr XRPAmount& operator=(beast::Zero)
|
||||
constexpr XRPAmount&
|
||||
operator=(beast::Zero)
|
||||
{
|
||||
drops_ = 0;
|
||||
return *this;
|
||||
@@ -155,7 +156,8 @@ public:
|
||||
}
|
||||
|
||||
/** Returns true if the amount is not zero */
|
||||
explicit constexpr operator bool() const noexcept
|
||||
explicit constexpr
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return drops_ != 0;
|
||||
}
|
||||
|
||||
@@ -521,7 +521,8 @@ public:
|
||||
return bytes;
|
||||
}
|
||||
|
||||
base_uint<Bits, Tag>& operator=(beast::Zero)
|
||||
base_uint<Bits, Tag>&
|
||||
operator=(beast::Zero)
|
||||
{
|
||||
data_.fill(0);
|
||||
return *this;
|
||||
|
||||
@@ -30,8 +30,8 @@ namespace ripple {
|
||||
|
||||
template <class Dest, class Src>
|
||||
static constexpr bool is_safetocasttovalue_v =
|
||||
(std::is_integral_v<Src> && std::is_integral_v<Dest>)&&(
|
||||
std::is_signed<Src>::value || std::is_unsigned<Dest>::value) &&
|
||||
(std::is_integral_v<Src> && std::is_integral_v<Dest>) &&
|
||||
(std::is_signed<Src>::value || std::is_unsigned<Dest>::value) &&
|
||||
(std::is_signed<Src>::value != std::is_signed<Dest>::value
|
||||
? sizeof(Dest) > sizeof(Src)
|
||||
: sizeof(Dest) >= sizeof(Src));
|
||||
|
||||
@@ -187,7 +187,8 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
explicit operator Int() const noexcept
|
||||
explicit
|
||||
operator Int() const noexcept
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
@@ -846,8 +846,9 @@ public:
|
||||
// set
|
||||
template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
|
||||
auto
|
||||
insert(value_type&& value) -> typename std::
|
||||
enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type;
|
||||
insert(value_type&& value) -> typename std::enable_if<
|
||||
!maybe_multi && !maybe_map,
|
||||
std::pair<iterator, bool>>::type;
|
||||
|
||||
// multiset
|
||||
template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
|
||||
@@ -1795,7 +1796,8 @@ template <
|
||||
template <bool maybe_multi, bool maybe_map>
|
||||
auto
|
||||
aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::
|
||||
insert(value_type&& value) -> typename std::
|
||||
insert(value_type&& value) ->
|
||||
typename std::
|
||||
enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type
|
||||
{
|
||||
typename cont_type::insert_commit_data d;
|
||||
|
||||
@@ -1057,8 +1057,9 @@ public:
|
||||
// map, set
|
||||
template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
|
||||
auto
|
||||
insert(value_type&& value) -> typename std::
|
||||
enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type;
|
||||
insert(value_type&& value) -> typename std::enable_if<
|
||||
!maybe_multi && !maybe_map,
|
||||
std::pair<iterator, bool>>::type;
|
||||
|
||||
// multimap, multiset
|
||||
template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
|
||||
@@ -2799,8 +2800,9 @@ aged_unordered_container<
|
||||
Clock,
|
||||
Hash,
|
||||
KeyEqual,
|
||||
Allocator>::insert(value_type&& value) -> typename std::
|
||||
enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type
|
||||
Allocator>::insert(value_type&& value) ->
|
||||
typename std::
|
||||
enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type
|
||||
{
|
||||
maybe_rehash(1);
|
||||
typename cont_type::insert_commit_data d;
|
||||
|
||||
@@ -90,7 +90,8 @@ public:
|
||||
XXH3_64bits_update(state_, key, len);
|
||||
}
|
||||
|
||||
explicit operator std::size_t() noexcept
|
||||
explicit
|
||||
operator std::size_t() noexcept
|
||||
{
|
||||
return XXH3_64bits_digest(state_);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#ifndef BEAST_EXPECT
|
||||
#define BEAST_EXPECT_S1(x) #x
|
||||
#define BEAST_EXPECT_S2(x) BEAST_EXPECT_S1(x)
|
||||
//#define BEAST_EXPECT(cond) {expect(cond, __FILE__ ":" ##
|
||||
// #define BEAST_EXPECT(cond) {expect(cond, __FILE__ ":" ##
|
||||
//__LINE__);}while(false){}
|
||||
#define BEAST_EXPECT(cond) expect(cond, __FILE__ ":" BEAST_EXPECT_S2(__LINE__))
|
||||
#endif
|
||||
|
||||
@@ -238,7 +238,8 @@ public:
|
||||
return m_sink.active(m_level);
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
explicit
|
||||
operator bool() const
|
||||
{
|
||||
return active();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
constexpr operator const char*() const
|
||||
constexpr
|
||||
operator const char*() const
|
||||
{
|
||||
return str_;
|
||||
}
|
||||
@@ -296,7 +297,8 @@ public:
|
||||
|
||||
/** Returns false if this is an empty array, empty object, empty string,
|
||||
or null. */
|
||||
explicit operator bool() const;
|
||||
explicit
|
||||
operator bool() const;
|
||||
|
||||
/// Remove all object members and array elements.
|
||||
/// \pre type() is arrayValue, objectValue, or nullValue
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <xrpl/protocol/tokens.h>
|
||||
// VFALCO Uncomment when the header issues are resolved
|
||||
//#include <ripple/protocol/PublicKey.h>
|
||||
// #include <ripple/protocol/PublicKey.h>
|
||||
#include <xrpl/basics/UnorderedContainers.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/json/json_value.h>
|
||||
|
||||
@@ -76,38 +76,35 @@ static_assert(apiMaximumValidVersion >= apiMaximumSupportedVersion);
|
||||
} // namespace RPC
|
||||
|
||||
template <unsigned minVer, unsigned maxVer, typename Fn, typename... Args>
|
||||
void
|
||||
forApiVersions(Fn const& fn, Args&&... args) requires //
|
||||
(maxVer >= minVer) && //
|
||||
(minVer >= RPC::apiMinimumSupportedVersion) && //
|
||||
(RPC::apiMaximumValidVersion >= maxVer) &&
|
||||
requires
|
||||
{
|
||||
fn(std::integral_constant<unsigned int, minVer>{},
|
||||
std::forward<Args>(args)...);
|
||||
fn(std::integral_constant<unsigned int, maxVer>{},
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
void
|
||||
forApiVersions(Fn const& fn, Args&&... args)
|
||||
requires //
|
||||
(maxVer >= minVer) && //
|
||||
(minVer >= RPC::apiMinimumSupportedVersion) && //
|
||||
(RPC::apiMaximumValidVersion >= maxVer) && requires {
|
||||
fn(std::integral_constant<unsigned int, minVer>{},
|
||||
std::forward<Args>(args)...);
|
||||
fn(std::integral_constant<unsigned int, maxVer>{},
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
{
|
||||
constexpr auto size = maxVer + 1 - minVer;
|
||||
[&]<std::size_t... offset>(std::index_sequence<offset...>)
|
||||
{
|
||||
[&]<std::size_t... offset>(std::index_sequence<offset...>) {
|
||||
(((void)fn(
|
||||
std::integral_constant<unsigned int, minVer + offset>{},
|
||||
std::forward<Args>(args)...)),
|
||||
...);
|
||||
}
|
||||
(std::make_index_sequence<size>{});
|
||||
}(std::make_index_sequence<size>{});
|
||||
}
|
||||
|
||||
template <typename Fn, typename... Args>
|
||||
void
|
||||
forAllApiVersions(Fn const& fn, Args&&... args) requires requires
|
||||
{
|
||||
forApiVersions<
|
||||
RPC::apiMinimumSupportedVersion,
|
||||
RPC::apiMaximumValidVersion>(fn, std::forward<Args>(args)...);
|
||||
}
|
||||
forAllApiVersions(Fn const& fn, Args&&... args)
|
||||
requires requires {
|
||||
forApiVersions<
|
||||
RPC::apiMinimumSupportedVersion,
|
||||
RPC::apiMaximumValidVersion>(fn, std::forward<Args>(args)...);
|
||||
}
|
||||
{
|
||||
forApiVersions<
|
||||
RPC::apiMinimumSupportedVersion,
|
||||
|
||||
@@ -80,9 +80,8 @@ struct MultiApiJson
|
||||
}
|
||||
|
||||
void
|
||||
set(const char* key,
|
||||
auto const&
|
||||
v) requires std::constructible_from<Json::Value, decltype(v)>
|
||||
set(const char* key, auto const& v)
|
||||
requires std::constructible_from<Json::Value, decltype(v)>
|
||||
{
|
||||
for (auto& a : this->val)
|
||||
a[key] = v;
|
||||
@@ -110,7 +109,8 @@ struct MultiApiJson
|
||||
unsigned int Version,
|
||||
typename... Args,
|
||||
typename Fn>
|
||||
requires std::same_as<std::remove_cvref_t<Json>, MultiApiJson> auto
|
||||
requires std::same_as<std::remove_cvref_t<Json>, MultiApiJson>
|
||||
auto
|
||||
operator()(
|
||||
Json& json,
|
||||
std::integral_constant<unsigned int, Version> const version,
|
||||
@@ -133,7 +133,8 @@ struct MultiApiJson
|
||||
|
||||
// integral_constant version, Json only
|
||||
template <typename Json, unsigned int Version, typename Fn>
|
||||
requires std::same_as<std::remove_cvref_t<Json>, MultiApiJson> auto
|
||||
requires std::same_as<std::remove_cvref_t<Json>, MultiApiJson>
|
||||
auto
|
||||
operator()(
|
||||
Json& json,
|
||||
std::integral_constant<unsigned int, Version> const,
|
||||
@@ -151,10 +152,10 @@ struct MultiApiJson
|
||||
typename... Args,
|
||||
typename Fn>
|
||||
requires(!some_integral_constant<Version>) &&
|
||||
std::convertible_to<Version, unsigned>&& std::same_as<
|
||||
std::remove_cvref_t<Json>,
|
||||
MultiApiJson> auto
|
||||
operator()(Json& json, Version version, Fn fn, Args&&... args) const
|
||||
std::convertible_to<Version, unsigned> &&
|
||||
std::same_as<std::remove_cvref_t<Json>, MultiApiJson>
|
||||
auto
|
||||
operator()(Json& json, Version version, Fn fn, Args&&... args) const
|
||||
-> std::
|
||||
invoke_result_t<Fn, decltype(json.val[0]), Version, Args&&...>
|
||||
{
|
||||
@@ -170,9 +171,10 @@ struct MultiApiJson
|
||||
// unsigned int version, Json only
|
||||
template <typename Json, typename Version, typename Fn>
|
||||
requires(!some_integral_constant<Version>) &&
|
||||
std::convertible_to<Version, unsigned>&& std::
|
||||
same_as<std::remove_cvref_t<Json>, MultiApiJson> auto
|
||||
operator()(Json& json, Version version, Fn fn) const
|
||||
std::convertible_to<Version, unsigned> &&
|
||||
std::same_as<std::remove_cvref_t<Json>, MultiApiJson>
|
||||
auto
|
||||
operator()(Json& json, Version version, Fn fn) const
|
||||
-> std::invoke_result_t<Fn, decltype(json.val[0])>
|
||||
{
|
||||
assert(
|
||||
@@ -184,53 +186,43 @@ struct MultiApiJson
|
||||
auto
|
||||
visit()
|
||||
{
|
||||
return [self = this](auto... args) requires requires
|
||||
{
|
||||
visitor(
|
||||
std::declval<MultiApiJson&>(),
|
||||
std::declval<decltype(args)>()...);
|
||||
}
|
||||
{
|
||||
return visitor(*self, std::forward<decltype(args)>(args)...);
|
||||
};
|
||||
return [self = this](auto... args)
|
||||
requires requires {
|
||||
visitor(
|
||||
std::declval<MultiApiJson&>(),
|
||||
std::declval<decltype(args)>()...);
|
||||
}
|
||||
{ return visitor(*self, std::forward<decltype(args)>(args)...); };
|
||||
}
|
||||
|
||||
auto
|
||||
visit() const
|
||||
{
|
||||
return [self = this](auto... args) requires requires
|
||||
{
|
||||
visitor(
|
||||
std::declval<MultiApiJson const&>(),
|
||||
std::declval<decltype(args)>()...);
|
||||
}
|
||||
{
|
||||
return visitor(*self, std::forward<decltype(args)>(args)...);
|
||||
};
|
||||
return [self = this](auto... args)
|
||||
requires requires {
|
||||
visitor(
|
||||
std::declval<MultiApiJson const&>(),
|
||||
std::declval<decltype(args)>()...);
|
||||
}
|
||||
{ return visitor(*self, std::forward<decltype(args)>(args)...); };
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
auto
|
||||
visit(Args... args)
|
||||
-> std::invoke_result_t<visitor_t, MultiApiJson&, Args...> requires(
|
||||
sizeof...(args) > 0) &&
|
||||
requires
|
||||
{
|
||||
visitor(*this, std::forward<decltype(args)>(args)...);
|
||||
}
|
||||
auto
|
||||
visit(Args... args)
|
||||
-> std::invoke_result_t<visitor_t, MultiApiJson&, Args...>
|
||||
requires(sizeof...(args) > 0) &&
|
||||
requires { visitor(*this, std::forward<decltype(args)>(args)...); }
|
||||
{
|
||||
return visitor(*this, std::forward<decltype(args)>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
auto
|
||||
visit(Args... args) const -> std::
|
||||
invoke_result_t<visitor_t, MultiApiJson const&, Args...> requires(
|
||||
sizeof...(args) > 0) &&
|
||||
requires
|
||||
{
|
||||
visitor(*this, std::forward<decltype(args)>(args)...);
|
||||
}
|
||||
auto
|
||||
visit(Args... args) const
|
||||
-> std::invoke_result_t<visitor_t, MultiApiJson const&, Args...>
|
||||
requires(sizeof...(args) > 0) &&
|
||||
requires { visitor(*this, std::forward<decltype(args)>(args)...); }
|
||||
{
|
||||
return visitor(*this, std::forward<decltype(args)>(args)...);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,8 @@ public:
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
explicit operator bool() const noexcept;
|
||||
explicit
|
||||
operator bool() const noexcept;
|
||||
|
||||
STAmount&
|
||||
operator+=(STAmount const&);
|
||||
@@ -388,7 +389,8 @@ inline STAmount::operator Number() const
|
||||
return iou();
|
||||
}
|
||||
|
||||
inline STAmount& STAmount::operator=(beast::Zero)
|
||||
inline STAmount&
|
||||
STAmount::operator=(beast::Zero)
|
||||
{
|
||||
clear();
|
||||
return *this;
|
||||
|
||||
@@ -52,11 +52,13 @@ struct JsonOptions
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr explicit operator underlying_t() const noexcept
|
||||
[[nodiscard]] constexpr explicit
|
||||
operator underlying_t() const noexcept
|
||||
{
|
||||
return value;
|
||||
}
|
||||
[[nodiscard]] constexpr explicit operator bool() const noexcept
|
||||
[[nodiscard]] constexpr explicit
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return value != 0u;
|
||||
}
|
||||
|
||||
@@ -539,7 +539,8 @@ public:
|
||||
Fields with soeDEFAULT and set to the
|
||||
default value will return `true`
|
||||
*/
|
||||
explicit operator bool() const noexcept;
|
||||
explicit
|
||||
operator bool() const noexcept;
|
||||
|
||||
/** Return the contained value
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ public:
|
||||
setValue(const STVector256& v);
|
||||
|
||||
/** Retrieve a copy of the vector we contain */
|
||||
explicit operator std::vector<uint256>() const;
|
||||
explicit
|
||||
operator std::vector<uint256>() const;
|
||||
|
||||
std::size_t
|
||||
size() const;
|
||||
|
||||
@@ -434,7 +434,8 @@ public:
|
||||
}
|
||||
|
||||
// Conversion to bool.
|
||||
explicit operator bool() const
|
||||
explicit
|
||||
operator bool() const
|
||||
{
|
||||
return code_ != tesSUCCESS;
|
||||
}
|
||||
@@ -480,60 +481,66 @@ public:
|
||||
// Only enabled if both arguments return int if TERtiInt is called with them.
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator==(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator==(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) == TERtoInt(rhs);
|
||||
}
|
||||
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator!=(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator!=(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) != TERtoInt(rhs);
|
||||
}
|
||||
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator<(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator<(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) < TERtoInt(rhs);
|
||||
}
|
||||
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator<=(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator<=(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) <= TERtoInt(rhs);
|
||||
}
|
||||
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator>(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator>(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) > TERtoInt(rhs);
|
||||
}
|
||||
|
||||
template <typename L, typename R>
|
||||
constexpr auto
|
||||
operator>=(L const& lhs, R const& rhs) -> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
operator>=(L const& lhs, R const& rhs)
|
||||
-> std::enable_if_t<
|
||||
std::is_same<decltype(TERtoInt(lhs)), int>::value &&
|
||||
std::is_same<decltype(TERtoInt(rhs)), int>::value,
|
||||
bool>
|
||||
{
|
||||
return TERtoInt(lhs) >= TERtoInt(rhs);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,8 @@ public:
|
||||
void
|
||||
operator()(void const* data, std::size_t size) noexcept;
|
||||
|
||||
explicit operator result_type() noexcept;
|
||||
explicit
|
||||
operator result_type() noexcept;
|
||||
|
||||
private:
|
||||
char ctx_[96];
|
||||
@@ -77,7 +78,8 @@ public:
|
||||
void
|
||||
operator()(void const* data, std::size_t size) noexcept;
|
||||
|
||||
explicit operator result_type() noexcept;
|
||||
explicit
|
||||
operator result_type() noexcept;
|
||||
|
||||
private:
|
||||
char ctx_[216];
|
||||
@@ -99,7 +101,8 @@ public:
|
||||
void
|
||||
operator()(void const* data, std::size_t size) noexcept;
|
||||
|
||||
explicit operator result_type() noexcept;
|
||||
explicit
|
||||
operator result_type() noexcept;
|
||||
|
||||
private:
|
||||
char ctx_[112];
|
||||
@@ -144,7 +147,8 @@ public:
|
||||
h_(data, size);
|
||||
}
|
||||
|
||||
explicit operator result_type() noexcept
|
||||
explicit
|
||||
operator result_type() noexcept
|
||||
{
|
||||
auto const d0 = sha256_hasher::result_type(h_);
|
||||
ripemd160_hasher rh;
|
||||
@@ -184,18 +188,21 @@ public:
|
||||
h_(data, size);
|
||||
}
|
||||
|
||||
explicit operator result_type() noexcept
|
||||
explicit
|
||||
operator result_type() noexcept
|
||||
{
|
||||
auto const digest = sha512_hasher::result_type(h_);
|
||||
return result_type::fromVoid(digest.data());
|
||||
}
|
||||
|
||||
private:
|
||||
inline void erase(std::false_type)
|
||||
inline void
|
||||
erase(std::false_type)
|
||||
{
|
||||
}
|
||||
|
||||
inline void erase(std::true_type)
|
||||
inline void
|
||||
erase(std::true_type)
|
||||
{
|
||||
secure_erase(&h_, sizeof(h_));
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ BaseHTTPPeer<Handler, Impl>::close()
|
||||
return post(
|
||||
strand_,
|
||||
std::bind(
|
||||
(void (BaseHTTPPeer::*)(void)) & BaseHTTPPeer::close,
|
||||
(void(BaseHTTPPeer::*)(void)) & BaseHTTPPeer::close,
|
||||
impl().shared_from_this()));
|
||||
boost::beast::get_lowest_layer(impl().stream_).close();
|
||||
}
|
||||
@@ -507,7 +507,7 @@ BaseHTTPPeer<Handler, Impl>::close(bool graceful)
|
||||
return post(
|
||||
strand_,
|
||||
std::bind(
|
||||
(void (BaseHTTPPeer::*)(bool)) &
|
||||
(void(BaseHTTPPeer::*)(bool)) &
|
||||
BaseHTTPPeer<Handler, Impl>::close,
|
||||
impl().shared_from_this(),
|
||||
graceful));
|
||||
|
||||
Reference in New Issue
Block a user