diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 6a2714ec..fab58e11 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -74,39 +74,6 @@ namespace etl //***************************************************************************** namespace etl { - // We can't have std::swap and etl::swap templates coexisting in the unit tests - // as the compiler will be unable to decide of which one to use, due to ADL. -#if defined(ETL_NO_STL) && !defined(ETL_IN_UNIT_TEST) - //*************************************************************************** - // swap -#if ETL_CPP11_SUPPORTED - template - void swap(T& a, T& b) ETL_NOEXCEPT - { - T temp(etl::move(a)); - a = etl::move(b); - b = etl::move(temp); - } -#else - template - void swap(T& a, T& b) ETL_NOEXCEPT - { - T temp(a); - a = b; - b = temp; - } -#endif - - template< class T, size_t N > - void swap(T(&a)[N], T(&b)[N]) ETL_NOEXCEPT - { - for (size_t i = 0; i < N; ++i) - { - swap(a[i], b[i]); - } -} -#endif - #if defined(ETL_NO_STL) //*************************************************************************** // iter_swap diff --git a/include/etl/utility.h b/include/etl/utility.h index 3b79f30a..742c6aa5 100644 --- a/include/etl/utility.h +++ b/include/etl/utility.h @@ -65,6 +65,39 @@ namespace etl } #endif + // We can't have std::swap and etl::swap templates coexisting in the unit tests + // as the compiler will be unable to decide of which one to use, due to ADL. +#if defined(ETL_NO_STL) && !defined(ETL_IN_UNIT_TEST) + //*************************************************************************** + // swap +#if ETL_CPP11_SUPPORTED + template + void swap(T& a, T& b) ETL_NOEXCEPT + { + T temp(etl::move(a)); + a = etl::move(b); + b = etl::move(temp); + } +#else + template + void swap(T& a, T& b) ETL_NOEXCEPT + { + T temp(a); + a = b; + b = temp; + } +#endif + + template< class T, size_t N > + void swap(T(&a)[N], T(&b)[N]) ETL_NOEXCEPT + { + for (size_t i = 0; i < N; ++i) + { + swap(a[i], b[i]); + } + } +#endif + //****************************************************************************** template struct pair diff --git a/include/etl/version.h b/include/etl/version.h index 94fa8d22..c9eed941 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 16 #define ETL_VERSION_MINOR 4 -#define ETL_VERSION_PATCH 2 +#define ETL_VERSION_PATCH 3 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 99059fc2..a498996b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "16.4.2", + "version": "16.4.3", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 124bb891..bcf13ffd 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=16.4.2 +version=16.4.3 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 96083f41..a59f8d81 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,8 @@ +=============================================================================== +16.4.3 +Rearranged where etl::swap is defined to fix issues with certain compilers +Fixed most warnings for CLang + =============================================================================== 16.4.2 Fix etl::pair error and warning.