From 91ea6057d632184c1969a6ffcba314c0623875f4 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Tue, 20 Oct 2020 20:26:19 -0400 Subject: [PATCH] TestArray: constexpr_sum using span Problem: - `constexpr_sum` is implemented using `Array` which means the function needs to be a function template so that the size can be deduced. Solution: - Change the `Array` function argument to a `Span` since `Span` now is `constexpr`. --- AK/Tests/TestArray.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/AK/Tests/TestArray.cpp b/AK/Tests/TestArray.cpp index 4aaf485956..61786c8121 100644 --- a/AK/Tests/TestArray.cpp +++ b/AK/Tests/TestArray.cpp @@ -28,12 +28,10 @@ #include -// FIXME: Use Span as soon as Span has all the constexpr stuff too. -template -static constexpr int constexpr_sum(const Array& array) +static constexpr int constexpr_sum(const Span span) { int sum = 0; - for (auto value : array) + for (auto value : span) sum += value; return sum;