diff --git a/include/bmath/mint.hh b/include/bmath/mint.hh index 12356af..ff958fe 100644 --- a/include/bmath/mint.hh +++ b/include/bmath/mint.hh @@ -51,6 +51,7 @@ class mint { } [[nodiscard]] constexpr mint operator/(mint const other) const noexcept { + // TODO: if consteval if constexpr (other.get() == 0) { static_assert(false, "Cannot divide by 0"); } else if (other.get() == 0) { @@ -96,6 +97,7 @@ class mint { return *this; } + // TODO: check this constexpr mint operator++(int) noexcept { auto _this = *this; diff --git a/include/bmath/sieve.hh b/include/bmath/sieve.hh index 5df219e..e172e10 100644 --- a/include/bmath/sieve.hh +++ b/include/bmath/sieve.hh @@ -40,6 +40,7 @@ class Eratosthenes : public Sieve, Limit> { [[nodiscard]] constexpr bool operator[](size_t const number) const { if consteval { + // TODO: does/can this run at compile time? if (number > Limit) { throw std::out_of_range( std::format("cannot determine primality of {} > size of sieve {}", diff --git a/tests/test_sieve.cc b/tests/test_sieve.cc index 19fa66d..2feee79 100644 --- a/tests/test_sieve.cc +++ b/tests/test_sieve.cc @@ -28,6 +28,7 @@ TEST(SieveTest, BasicConstruction) { Eratosthenes<100> sieve; } TEST(SieveTest, ValidateAgainstNaive) { Eratosthenes<1000> sieve; + // TODO: assert done at compile time for (size_t i = 0; i <= 1000; ++i) { EXPECT_EQ(sieve[i], naive_prime(i)) << "Sieve disagrees with naive checker for " << i;