Bitcoin Core 31.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | Friends | List of all members
ByRatioNegSize< T > Class Template Reference

Wrapper around FeeFrac & derived types, which adds a total ordering which first sorts by feerate and then by reversed size (i.e., larger sizes come first). More...

#include <feefrac.h>

Collaboration diagram for ByRatioNegSize< T >:
[legend]

Public Member Functions

constexpr ByRatioNegSize (const T &feefrac) noexcept
 
 operator const T & () const noexcept
 

Private Attributes

const Tm_feefrac
 

Friends

bool operator== (const ByRatioNegSize &a, const ByRatioNegSize &b) noexcept
 
std::strong_ordering operator<=> (const ByRatioNegSize &a, const ByRatioNegSize &b) noexcept
 

Detailed Description

template<std::derived_from< FeeFrac > T>
class ByRatioNegSize< T >

Wrapper around FeeFrac & derived types, which adds a total ordering which first sorts by feerate and then by reversed size (i.e., larger sizes come first).

This is not included inside FeeFrac itself, because it is not the most natural behavior, so it is better to make code using it invoke this explicitly.

The empty FeeFrac (fee and size both 0) sorts last. So for example, the following FeeFracs are in sorted order:

Definition at line 289 of file feefrac.h.

Constructor & Destructor Documentation

◆ ByRatioNegSize()

template<std::derived_from< FeeFrac > T>
constexpr ByRatioNegSize< T >::ByRatioNegSize ( const T feefrac)
inlineconstexprnoexcept

Definition at line 294 of file feefrac.h.

Member Function Documentation

◆ operator const T &()

template<std::derived_from< FeeFrac > T>
ByRatioNegSize< T >::operator const T & ( ) const
inlinenoexcept

Definition at line 311 of file feefrac.h.

Friends And Related Function Documentation

◆ operator<=>

template<std::derived_from< FeeFrac > T>
std::strong_ordering operator<=> ( const ByRatioNegSize< T > &  a,
const ByRatioNegSize< T > &  b 
)
friend

Definition at line 301 of file feefrac.h.

◆ operator==

template<std::derived_from< FeeFrac > T>
bool operator== ( const ByRatioNegSize< T > &  a,
const ByRatioNegSize< T > &  b 
)
friend

Definition at line 296 of file feefrac.h.

Member Data Documentation

◆ m_feefrac

template<std::derived_from< FeeFrac > T>
const T& ByRatioNegSize< T >::m_feefrac
private

Definition at line 291 of file feefrac.h.


The documentation for this class was generated from the following file: