From f495ad9e756ffea6c267da84ce51d78a1b717953 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Sat, 19 Mar 2022 17:27:38 +0000 Subject: [PATCH] Replace `accumulate` with `reduce` Perhaps this will also satisfy Apple's Clang 13? Since `reduce` is newer, it may be more likely to be `constexpr` compatible. --- src/core/include/units/bits/prime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/include/units/bits/prime.h b/src/core/include/units/bits/prime.h index 698f05bf..648dcce8 100644 --- a/src/core/include/units/bits/prime.h +++ b/src/core/include/units/bits/prime.h @@ -101,7 +101,7 @@ constexpr auto coprimes_up_to(std::size_t n, const std::array& b template constexpr std::size_t product(const std::array& values) { - return std::accumulate(std::begin(values), std::end(values), std::size_t{1u}, std::multiplies{}); + return std::reduce(values.begin(), values.end(), std::size_t{1}, std::multiplies{}); } // A configurable instantiation of the "wheel factorization" algorithm [1] for prime numbers.