moved TYPE checks to tests

This commit is contained in:
Ahmet Inan 2024-03-24 11:10:49 +01:00
commit 485f6afe42
2 changed files with 4 additions and 4 deletions

View file

@ -6,15 +6,11 @@ Copyright 2024 Ahmet Inan <inan@aicodix.de>
#pragma once
#include <cassert>
namespace CODE {
template <typename TYPE, TYPE PRIME>
struct PrimeField
{
static_assert(std::is_unsigned<TYPE>::value, "TYPE must be unsigned");
static_assert(std::numeric_limits<TYPE>::max() / (PRIME-1) >= (PRIME-1), "Type not wide enough");
static constexpr TYPE P = PRIME;
TYPE v;
PrimeField() = default;