diff --git a/include/bmath/sieve.hh b/include/bmath/sieve.hh index d9886d7..5df219e 100644 --- a/include/bmath/sieve.hh +++ b/include/bmath/sieve.hh @@ -12,7 +12,7 @@ template requires(Limit > 0) class Sieve { public: - constexpr explicit Sieve() { static_cast(this)->build(); } + constexpr explicit Sieve() noexcept { static_cast(this)->build(); } protected: std::bitset sieve; @@ -41,13 +41,15 @@ class Eratosthenes : public Sieve, Limit> { [[nodiscard]] constexpr bool operator[](size_t const number) const { if consteval { if (number > Limit) { - throw std::out_of_range(std::format( - "cannot determine primality of {} > LIMIT={}", number, Limit)); + throw std::out_of_range( + std::format("cannot determine primality of {} > size of sieve {}", + number, Limit)); } } else { if (number > Limit) { - throw std::out_of_range(std::format( - "cannot determine primality of {} > LIMIT={}", number, Limit)); + throw std::out_of_range( + std::format("cannot determine primality of {} > size of sieve {}", + number, Limit)); } }