forked from wownero/wownero
Merge pull request #6922
a25bc71
Make Blockchain::get_fee_quantization_mask() compile time (SChernykh)
release-v0.10.0.3
commit
999e797cea
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
namespace tools
|
||||||
|
{
|
||||||
|
template<uint64_t a, uint64_t b>
|
||||||
|
struct PowerOf
|
||||||
|
{
|
||||||
|
enum Data : uint64_t
|
||||||
|
{
|
||||||
|
// a^b = a * a^(b-1)
|
||||||
|
Value = a * PowerOf<a, b - 1>::Value,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
template<uint64_t a>
|
||||||
|
struct PowerOf<a, 0>
|
||||||
|
{
|
||||||
|
enum Data : uint64_t
|
||||||
|
{
|
||||||
|
// a^0 = 1
|
||||||
|
Value = 1,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in new issue