Remove duplicate static_asserts

One should be enough. Can be reviewed with
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
This commit is contained in:
MarcoFalke 2022-04-14 19:34:33 +02:00
parent d0f7493b6c
commit fa456ccb22
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -24,22 +24,19 @@ template<unsigned int BITS>
class base_uint class base_uint
{ {
protected: protected:
static_assert(BITS / 32 > 0 && BITS % 32 == 0, "Template parameter BITS must be a positive multiple of 32.");
static constexpr int WIDTH = BITS / 32; static constexpr int WIDTH = BITS / 32;
uint32_t pn[WIDTH]; uint32_t pn[WIDTH];
public: public:
base_uint() base_uint()
{ {
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
for (int i = 0; i < WIDTH; i++) for (int i = 0; i < WIDTH; i++)
pn[i] = 0; pn[i] = 0;
} }
base_uint(const base_uint& b) base_uint(const base_uint& b)
{ {
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
for (int i = 0; i < WIDTH; i++) for (int i = 0; i < WIDTH; i++)
pn[i] = b.pn[i]; pn[i] = b.pn[i];
} }
@ -53,8 +50,6 @@ public:
base_uint(uint64_t b) base_uint(uint64_t b)
{ {
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
pn[0] = (unsigned int)b; pn[0] = (unsigned int)b;
pn[1] = (unsigned int)(b >> 32); pn[1] = (unsigned int)(b >> 32);
for (int i = 2; i < WIDTH; i++) for (int i = 2; i < WIDTH; i++)