mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 09:46:53 +00:00
Update formatting
This commit is contained in:
@@ -434,8 +434,8 @@ private:
|
||||
// by value.
|
||||
template <
|
||||
typename T,
|
||||
typename V =
|
||||
typename std::remove_cv<typename std::remove_reference<decltype(std::declval<T>().value())>::type>::type>
|
||||
typename V = typename std::remove_cv<
|
||||
typename std::remove_reference<decltype(std::declval<T>().value())>::type>::type>
|
||||
V
|
||||
getFieldByValue(SField const& field) const;
|
||||
|
||||
@@ -510,10 +510,14 @@ protected:
|
||||
// Constraint += and -= ValueProxy operators
|
||||
// to value types that support arithmetic operations
|
||||
template <typename U>
|
||||
concept IsArithmeticNumber = std::is_arithmetic_v<U> || std::is_same_v<U, Number> || std::is_same_v<U, STAmount>;
|
||||
template <typename U, typename Value = typename U::value_type, typename Unit = typename U::unit_type>
|
||||
concept IsArithmeticValueUnit =
|
||||
std::is_same_v<U, unit::ValueUnit<Unit, Value>> && IsArithmeticNumber<Value> && std::is_class_v<Unit>;
|
||||
concept IsArithmeticNumber =
|
||||
std::is_arithmetic_v<U> || std::is_same_v<U, Number> || std::is_same_v<U, STAmount>;
|
||||
template <
|
||||
typename U,
|
||||
typename Value = typename U::value_type,
|
||||
typename Unit = typename U::unit_type>
|
||||
concept IsArithmeticValueUnit = std::is_same_v<U, unit::ValueUnit<Unit, Value>> &&
|
||||
IsArithmeticNumber<Value> && std::is_class_v<Unit>;
|
||||
template <typename U, typename Value = typename U::value_type>
|
||||
concept IsArithmeticST = !IsArithmeticValueUnit<U> && IsArithmeticNumber<Value>;
|
||||
template <typename U>
|
||||
@@ -522,7 +526,8 @@ concept IsArithmetic = IsArithmeticNumber<U> || IsArithmeticST<U> || IsArithmeti
|
||||
template <class T, class U>
|
||||
concept Addable = requires(T t, U u) { t = t + u; };
|
||||
template <typename T, typename U>
|
||||
concept IsArithmeticCompatible = IsArithmetic<typename T::value_type> && Addable<typename T::value_type, U>;
|
||||
concept IsArithmeticCompatible =
|
||||
IsArithmetic<typename T::value_type> && Addable<typename T::value_type, U>;
|
||||
|
||||
template <class T>
|
||||
class STObject::ValueProxy : public Proxy<T>
|
||||
@@ -1056,12 +1061,15 @@ STObject::at(TypedField<T> const& f) const
|
||||
return u->value();
|
||||
|
||||
XRPL_ASSERT(mType, "xrpl::STObject::at(TypedField auto) : field template non-null");
|
||||
XRPL_ASSERT(b->getSType() == STI_NOTPRESENT, "xrpl::STObject::at(TypedField auto) : type not present");
|
||||
XRPL_ASSERT(
|
||||
b->getSType() == STI_NOTPRESENT, "xrpl::STObject::at(TypedField auto) : type not present");
|
||||
|
||||
if (mType->style(f) == soeOPTIONAL)
|
||||
Throw<STObject::FieldErr>("Missing optional field: " + f.getName());
|
||||
|
||||
XRPL_ASSERT(mType->style(f) == soeDEFAULT, "xrpl::STObject::at(TypedField auto) : template style is default");
|
||||
XRPL_ASSERT(
|
||||
mType->style(f) == soeDEFAULT,
|
||||
"xrpl::STObject::at(TypedField auto) : template style is default");
|
||||
|
||||
// Used to help handle the case where value_type is a const reference,
|
||||
// otherwise we would return the address of a temporary.
|
||||
@@ -1083,7 +1091,9 @@ STObject::at(OptionaledField<T> const& of) const
|
||||
mType,
|
||||
"xrpl::STObject::at(OptionaledField auto) : field template "
|
||||
"non-null");
|
||||
XRPL_ASSERT(b->getSType() == STI_NOTPRESENT, "xrpl::STObject::at(OptionaledField auto) : type not present");
|
||||
XRPL_ASSERT(
|
||||
b->getSType() == STI_NOTPRESENT,
|
||||
"xrpl::STObject::at(OptionaledField auto) : type not present");
|
||||
if (mType->style(*of.f) == soeOPTIONAL)
|
||||
return std::nullopt;
|
||||
XRPL_ASSERT(
|
||||
|
||||
Reference in New Issue
Block a user