From 3cd03fcb7f1c59fb27582e3e8ce744440bf5c092 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 5 Apr 2026 14:37:15 +0200 Subject: [PATCH 1/3] Fix initializer_list use in algorithm.h and definition of data() in iterator.h (#1374) * Print test names at test time (#1343) * Fix initializer_list use in algorithm.h Needs to be conditional. * Move definition of data() in iterator.h Needs to be defined earlier. --------- Co-authored-by: John Wellbelove --- include/etl/algorithm.h | 7 ++++ include/etl/iterator.h | 92 ++++++++++++++++++++--------------------- test/test_algorithm.cpp | 6 +++ 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 0a4348a2..63bfe13b 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -43,6 +43,7 @@ SOFTWARE. #include "exception.h" #include "functional.h" #include "gcd.h" +#include "initializer_list.h" #include "invoke.h" #include "iterator.h" #include "largest.h" @@ -7020,6 +7021,7 @@ namespace etl return etl::invoke(comp, etl::invoke(proj, b), etl::invoke(proj, a)) ? b : a; } + #if ETL_HAS_INITIALIZER_LIST template constexpr T operator()(std::initializer_list r, Comp comp = {}, Proj proj = {}) const { @@ -7036,6 +7038,7 @@ namespace etl } return *smallest; } + #endif template >> constexpr ranges::range_value_t operator()(R&& r, Comp comp = {}, Proj proj = {}) const @@ -7098,6 +7101,7 @@ namespace etl return etl::invoke(comp, etl::invoke(proj, a), etl::invoke(proj, b)) ? b : a; } + #if ETL_HAS_INITIALIZER_LIST template constexpr T operator()(std::initializer_list r, Comp comp = {}, Proj proj = {}) const { @@ -7114,6 +7118,7 @@ namespace etl } return *largest; } + #endif template >> constexpr ranges::range_value_t operator()(R&& r, Comp comp = {}, Proj proj = {}) const @@ -7180,6 +7185,7 @@ namespace etl return {a, b}; } + #if ETL_HAS_INITIALIZER_LIST template constexpr ranges::minmax_result operator()(std::initializer_list r, Comp comp = {}, Proj proj = {}) const { @@ -7202,6 +7208,7 @@ namespace etl } return {*smallest, *largest}; } + #endif template >> constexpr ranges::minmax_result> operator()(R&& r, Comp comp = {}, Proj proj = {}) const diff --git a/include/etl/iterator.h b/include/etl/iterator.h index fb62de80..8a09e7c0 100644 --- a/include/etl/iterator.h +++ b/include/etl/iterator.h @@ -1218,6 +1218,52 @@ namespace etl #define ETL_ARRAY_SIZE(a) sizeof(etl::array_size(a)) +#if ETL_NOT_USING_STL || ETL_CPP17_NOT_SUPPORTED + //************************************************************************** + /// Returns a pointer to the block of memory containing the elements of the + /// range. + ///\ingroup container + //************************************************************************** + template + ETL_CONSTEXPR typename TContainer::pointer data(TContainer& container) + { + return container.data(); + } + + //************************************************************************** + /// Returns a const_pointer to the block of memory containing the elements of + /// the range. + ///\ingroup container + //************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_pointer data(const TContainer& container) + { + return container.data(); + } + + ///************************************************************************** + /// Returns a pointer to the block of memory containing the elements of the + /// range. + ///\ingroup container + ///************************************************************************** + template + ETL_CONSTEXPR TValue* data(TValue (&a)[Array_Size]) + { + return a; + } + + ///************************************************************************** + /// Returns a const pointer to the block of memory containing the elements of + /// the range. + ///\ingroup container + ///************************************************************************** + template + ETL_CONSTEXPR const TValue* data(const TValue (&a)[Array_Size]) + { + return a; + } +#endif + #if ETL_USING_CPP17 template using iter_value_t = typename etl::iterator_traits>::value_type; @@ -1962,52 +2008,6 @@ namespace etl inline constexpr bool is_range_v = is_range::value; #endif #endif - -#if ETL_NOT_USING_STL || ETL_CPP17_NOT_SUPPORTED - //************************************************************************** - /// Returns a pointer to the block of memory containing the elements of the - /// range. - ///\ingroup container - //************************************************************************** - template - ETL_CONSTEXPR typename TContainer::pointer data(TContainer& container) - { - return container.data(); - } - - //************************************************************************** - /// Returns a const_pointer to the block of memory containing the elements of - /// the range. - ///\ingroup container - //************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_pointer data(const TContainer& container) - { - return container.data(); - } - - ///************************************************************************** - /// Returns a pointer to the block of memory containing the elements of the - /// range. - ///\ingroup container - ///************************************************************************** - template - ETL_CONSTEXPR TValue* data(TValue (&a)[Array_Size]) - { - return a; - } - - ///************************************************************************** - /// Returns a const pointer to the block of memory containing the elements of - /// the range. - ///\ingroup container - ///************************************************************************** - template - ETL_CONSTEXPR const TValue* data(const TValue (&a)[Array_Size]) - { - return a; - } -#endif } // namespace etl #endif diff --git a/test/test_algorithm.cpp b/test/test_algorithm.cpp index 26640d64..fa0f4f0e 100644 --- a/test/test_algorithm.cpp +++ b/test/test_algorithm.cpp @@ -16495,6 +16495,7 @@ namespace CHECK_EQUAL(3, etl::ranges::min(-5, 3, etl::ranges::less{}, abs_proj)); } + #if ETL_HAS_INITIALIZER_LIST //************************************************************************* TEST(ranges_min_initializer_list) { @@ -16517,6 +16518,7 @@ namespace }; CHECK_EQUAL(9, etl::ranges::min({3, 1, 4, 5, 9, 2, 6}, etl::ranges::less{}, negate)); } + #endif //************************************************************************* TEST(ranges_min_range) @@ -16692,6 +16694,7 @@ namespace CHECK_EQUAL(-5, etl::ranges::max(-5, 3, etl::ranges::less{}, abs_proj)); } + #if ETL_HAS_INITIALIZER_LIST //************************************************************************* TEST(ranges_max_initializer_list) { @@ -16714,6 +16717,7 @@ namespace }; CHECK_EQUAL(1, etl::ranges::max({3, 1, 4, 5, 9, 2, 6}, etl::ranges::less{}, negate)); } + #endif //************************************************************************* TEST(ranges_max_range) @@ -16914,6 +16918,7 @@ namespace CHECK_EQUAL(-5, result2.max); } + #if ETL_HAS_INITIALIZER_LIST //************************************************************************* TEST(ranges_minmax_initializer_list) { @@ -16945,6 +16950,7 @@ namespace CHECK_EQUAL(9, result.min); CHECK_EQUAL(1, result.max); } + #endif //************************************************************************* TEST(ranges_minmax_range) From ee04aa76c5aa66345096483f8abc014c14a29d1f Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 5 Apr 2026 14:03:25 +0100 Subject: [PATCH 2/3] VS2022 project update --- .gitignore | 5 +++++ test/vs2022/etl.vcxproj | 1 + test/vs2022/etl.vcxproj.filters | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0d41e526..d77af359 100644 --- a/.gitignore +++ b/.gitignore @@ -414,3 +414,8 @@ test/vs2022/Debug Clang C++20 - Optimised -O2 include/etl/header_file_list.txt temp test/syntax_check/build-make +hugo/public +hugo/resources +hugo/.hugo_build.lock +docs/*.html +test/build-coverage diff --git a/test/vs2022/etl.vcxproj b/test/vs2022/etl.vcxproj index 1134a9b9..93ea62c4 100644 --- a/test/vs2022/etl.vcxproj +++ b/test/vs2022/etl.vcxproj @@ -11526,6 +11526,7 @@ + diff --git a/test/vs2022/etl.vcxproj.filters b/test/vs2022/etl.vcxproj.filters index f7b7ccc9..4921e669 100644 --- a/test/vs2022/etl.vcxproj.filters +++ b/test/vs2022/etl.vcxproj.filters @@ -3798,7 +3798,7 @@ Tests\Callbacks & Delegates - Tests + Tests\Strings @@ -3979,6 +3979,17 @@ Resource Files\CI\Github + + Documentation + + + Documentation + + + + + Tests\Scripts + From 1a6762d6c38dc12bf6c84884e0ccb650706e5c1f Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 5 Apr 2026 14:13:22 +0100 Subject: [PATCH 3/3] Updated version and release notes --- arduino/library-arduino.json | 2 +- arduino/library-arduino.properties | 2 +- hugo/layouts/_default/baseof.html | 15 +++++++++++++++ hugo/layouts/_partials/footer.html | 4 ++++ include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 5 +++++ version.txt | 2 +- 9 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 hugo/layouts/_default/baseof.html create mode 100644 hugo/layouts/_partials/footer.html diff --git a/arduino/library-arduino.json b/arduino/library-arduino.json index 44c7157f..060f3244 100644 --- a/arduino/library-arduino.json +++ b/arduino/library-arduino.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library ETL", - "version": "20.47.0", + "version": "20.47.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/arduino/library-arduino.properties b/arduino/library-arduino.properties index 1dba8aee..0cbbe88b 100644 --- a/arduino/library-arduino.properties +++ b/arduino/library-arduino.properties @@ -1,5 +1,5 @@ name=Embedded Template Library ETL -version=20.47.0 +version=20.47.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/hugo/layouts/_default/baseof.html b/hugo/layouts/_default/baseof.html new file mode 100644 index 00000000..aa9ad53e --- /dev/null +++ b/hugo/layouts/_default/baseof.html @@ -0,0 +1,15 @@ + + + + + + {{ .Title }} | {{ .Site.Title }} + + +
+ {{ block "main" . }}{{ end }} +
+ + {{ partial "footer.html" . }} + + diff --git a/hugo/layouts/_partials/footer.html b/hugo/layouts/_partials/footer.html new file mode 100644 index 00000000..96a55962 --- /dev/null +++ b/hugo/layouts/_partials/footer.html @@ -0,0 +1,4 @@ +
+

© 2014–{{ now.Format "2006" }} {{ .Site.Title }}. All rights reserved.

+

+
diff --git a/include/etl/version.h b/include/etl/version.h index e6008c77..38480305 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -40,7 +40,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 20 #define ETL_VERSION_MINOR 47 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION \ ETL_STRING(ETL_VERSION_MAJOR) \ diff --git a/library.json b/library.json index 4d91a667..3dc67e2d 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "20.47.0", + "version": "20.47.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 5ef5c42f..c21ef73c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=20.47.0 +version=20.47.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index e72384ae..b42ba3bd 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,4 +1,9 @@ =============================================================================== +20.47.1 + +#1374 Fix initializer_list use in algorithm.h and definition of data() in iterator.h + +=============================================================================== 20.47.0 #1219 Topic/expected monadic operations diff --git a/version.txt b/version.txt index c3f1e1dc..1055985e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -20.47.0 +20.47.1