From bdf488db0430fd05a71bed06d514c9966db7e1f9 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Tue, 11 Jan 2022 19:34:57 -0500 Subject: [PATCH] Remove unnecessary forward declaration --- src/core/include/units/magnitude.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/core/include/units/magnitude.h b/src/core/include/units/magnitude.h index 63b510aa..6becff3d 100644 --- a/src/core/include/units/magnitude.h +++ b/src/core/include/units/magnitude.h @@ -167,14 +167,6 @@ constexpr std::intmax_t remove_power(std::intmax_t base, std::intmax_t pow, std: return n; } -// Helpers to perform prime factorization at compile time. -template - requires (N > 0) -struct prime_factorization; - -template -static constexpr auto prime_factorization_v = prime_factorization::value; - // A way to check whether a number is prime at compile time. constexpr bool is_prime(std::intmax_t n) { return (n > 1) && (find_first_factor(n) == n); } @@ -325,7 +317,7 @@ constexpr auto operator/(Magnitude auto l, Magnitude auto r) { return l * pow<-1 // `as_magnitude()` implementation. namespace detail { -// Default implementation. +// Helper to perform prime factorization at compile time. template requires (N > 0) struct prime_factorization { @@ -340,6 +332,9 @@ struct prime_factorization { // Specialization for the prime factorization of 1 (base case). template<> struct prime_factorization<1> { static constexpr magnitude<> value{}; }; + +template +static constexpr auto prime_factorization_v = prime_factorization::value; } // namespace detail template