diff --git a/include/etl/exception.h b/include/etl/exception.h index 90ab6e72..49e6adca 100644 --- a/include/etl/exception.h +++ b/include/etl/exception.h @@ -100,7 +100,7 @@ namespace etl //*************************************************************************** /// Gets the line for the exception. - /// \return const char* to the line. + /// \return int as line number. //*************************************************************************** ETL_CONSTEXPR numeric_type line_number() const diff --git a/include/etl/generators/type_traits_generator.h b/include/etl/generators/type_traits_generator.h index 35db7ea6..c1d73d10 100644 --- a/include/etl/generators/type_traits_generator.h +++ b/include/etl/generators/type_traits_generator.h @@ -2295,6 +2295,17 @@ typedef integral_constant true_type; template using signed_type_t = typename signed_type::type; #endif + +//********************************************* +// type_identity + +template +struct type_identity { typedef T type; }; + +#if ETL_USING_CPP11 + template + using type_identity_t = typename type_identity::type; +#endif } // Helper macros diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 93730e5a..1a40f026 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -2288,6 +2288,17 @@ typedef integral_constant true_type; template using signed_type_t = typename signed_type::type; #endif + +//********************************************* +// type_identity + +template +struct type_identity { typedef T type; }; + +#if ETL_USING_CPP11 + template + using type_identity_t = typename type_identity::type; +#endif } // Helper macros diff --git a/include/etl/version.h b/include/etl/version.h index adf1dd60..03eeaa26 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 38 -#define ETL_VERSION_PATCH 16 +#define ETL_VERSION_PATCH 17 #define ETL_VERSION ETL_STRING(ETL_VERSION_MAJOR) "." ETL_STRING(ETL_VERSION_MINOR) "." ETL_STRING(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_VERSION_MAJOR) L"." ETL_WIDE_STRING(ETL_VERSION_MINOR) L"." ETL_WIDE_STRING(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 38ab6fad..a2c651b0 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "20.38.16", + "version": "20.38.17", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index bf2326c9..5ce03aeb 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=20.38.16 +version=20.38.17 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 2d2cda54..cc50700d 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,4 +1,9 @@ =============================================================================== +20.38.17 + +#895 Removed std algorithm calls from algorithm.h + +=============================================================================== 20.38.16 Fixes: diff --git a/test/test_type_traits.cpp b/test/test_type_traits.cpp index 129a5fa8..84a3a14b 100644 --- a/test/test_type_traits.cpp +++ b/test/test_type_traits.cpp @@ -122,6 +122,13 @@ namespace NotDefaultConstructible(NotDefaultConstructible&&) = delete; NotDefaultConstructible& operator =(NotDefaultConstructible&) = delete; }; + + // A function to test etl::type_identity. + template + T type_identity_test_add(T first, typename etl::type_identity::type second) + { + return first + second; + } } // Definitions for when the STL and compiler built-ins are not available. @@ -1320,4 +1327,10 @@ namespace CHECK_FALSE(bool(etl::is_base_of_all::value)); #endif } + + //************************************************************************* + TEST(test_type_identity) + { + CHECK_CLOSE(type_identity_test_add(1.5f, 2), 3.5f, 0.01f); + } } diff --git a/version.txt b/version.txt index 13e96238..0a76ef65 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -20.38.16 +20.38.17