From 342e43e28befbfad9e565641c72e0301cb868010 Mon Sep 17 00:00:00 2001 From: mike919192 <91038685+mike919192@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:09:37 -0500 Subject: [PATCH 1/2] Fix discrepency with STL in max element and minmax element (#1245) --- include/etl/algorithm.h | 4 ++-- test/test_algorithm.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 08ebfeda..88b8f7b6 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -1528,7 +1528,7 @@ namespace etl while (begin != end) { - if (!compare(*begin, *maximum)) + if (compare(*maximum, *begin)) { maximum = begin; } @@ -1582,7 +1582,7 @@ namespace etl minimum = begin; } - if (compare(*maximum, *begin)) + if (!compare(*begin, *maximum)) { maximum = begin; } diff --git a/test/test_algorithm.cpp b/test/test_algorithm.cpp index b7573bb0..3fcfa1c4 100644 --- a/test/test_algorithm.cpp +++ b/test/test_algorithm.cpp @@ -53,7 +53,7 @@ namespace std::mt19937 urng(rng()); using Vector = std::vector; - Vector data = { 2, 1, 4, 3, 6, 5, 8, 7, 10, 9 }; + Vector data = { 2, 1, 1, 4, 3, 6, 5, 8, 7, 10, 10, 9 }; using VectorM = std::vector; From 339f5abf0fea8de08414ae43895afe3faa29dd4d Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 23 Dec 2025 07:10:10 +0000 Subject: [PATCH 2/2] Updated ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 068e7602..ced27dae 100644 --- a/.gitignore +++ b/.gitignore @@ -411,3 +411,4 @@ examples/UniquePtrWithPool/UniquePtrWithPool test/vs2022/Debug Clang C++20 - Optimised -O2 include/etl/header_file_list.txt temp +test/syntax_check/build-make