From 5e7c8f03827e0b8f33a126eb23f906fdb9e5cb0f Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Cordero Date: Wed, 17 Jun 2026 13:28:07 +0200 Subject: [PATCH] constrain calculate_stddev with std::ranges::input_range + std::is_arithmetic_v Signed-off-by: Alejandro Hernandez Cordero --- rttest/include/rttest/math_utils.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rttest/include/rttest/math_utils.hpp b/rttest/include/rttest/math_utils.hpp index 0c617e9..e5c3501 100644 --- a/rttest/include/rttest/math_utils.hpp +++ b/rttest/include/rttest/math_utils.hpp @@ -18,10 +18,13 @@ #include #include #include +#include +#include #include -template -double calculate_stddev(const container & vec) +template + requires std::is_arithmetic_v> +double calculate_stddev(const Container & vec) { double n = vec.size(); double mean = std::accumulate(