[#FeePerUnit] = FeePerUnit :mrdocs: Tagged wrapper around FeeFrac to avoid unit confusion. == Synopsis Declared in `<util/feefrac.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Tag> struct FeePerUnit : xref:FeeFrac.adoc[FeeFrac] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:FeeFrac.adoc[FeeFrac]` | Data structure storing a fee and size. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:FeeFrac/operator_assign.adoc[`operator=`] | Copy‐assign the fee and size from another FeeFrac. | xref:FeeFrac/EvaluateFee.adoc[`EvaluateFee`] | Compute the fee for a given size `at_size` using this object's feerate. | xref:FeeFrac/EvaluateFeeDown.adoc[`EvaluateFeeDown`] | Compute the fee for a given size `at_size` using this object's feerate, rounding down. | xref:FeeFrac/EvaluateFeeUp.adoc[`EvaluateFeeUp`] | Compute the fee for a given size `at_size` using this object's feerate, rounding up. | xref:FeeFrac/IsEmpty.adoc[`IsEmpty`] | Check if this is empty (size and fee are 0). | xref:FeeFrac/operator_plus_eq.adoc[`operator+=`] | Add fee and size of another FeeFrac to this one. | xref:FeeFrac/operator_minus_eq.adoc[`operator‐=`] | Subtract fee and size of another FeeFrac from this one. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:FeeFrac/Div.adoc[`Div`] | Helper function for 96/32 signed division, rounding towards negative infinity (if round_down), or towards positive infinity (if !round_down). This is a version relying on __int128. | xref:FeeFrac/DivFallback.adoc[`DivFallback`] | Helper function for 96/32 signed division, rounding towards negative infinity (if round_down) or positive infinity (if !round_down). This is a fallback version, separate so that it can be tested on platforms where it isn't actually needed. | xref:FeePerUnit/FromFeeFrac.adoc[`FromFeeFrac`] | Convert a FeeFrac to a FeePerUnit. | xref:FeeFrac/Mul.adoc[`Mul`] | Helper function for 32*64 signed multiplication, returning an unspecified but totally ordered type. This is a version relying on __int128. | xref:FeeFrac/MulFallback.adoc[`MulFallback`] | Helper function for 32*64 signed multiplication, returning an unspecified but totally ordered type. This is a fallback version, separate so it can be tested on platforms where it isn't actually needed. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:FeeFrac/fee.adoc[`fee`] | The fee, in satoshis. | xref:FeeFrac/size.adoc[`size`] | The size, in the unit chosen by the caller (for example vbytes or weight units). |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:FeePerUnit/2constructor.adoc[`FeePerUnit`] | Inherit the FeeFrac constructors. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:operator_plus-0f3.adoc[`operator+`] | Sum fee and size. | xref:operator_minus-0b.adoc[`operator‐`] | Subtract both fee and size. | xref:operator_eq-03b.adoc[`operator==`] | Check if two FeeFrac objects are equal (both same fee and same size). | xref:swap-02.adoc[`swap`] | Swap two FeeFracs. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#