From 3805cb7aa703525c545eb455492c4cecb396ac03 Mon Sep 17 00:00:00 2001 From: tigran2008 Date: Mon, 10 Jun 2024 18:31:10 +0400 Subject: [PATCH] etl/type_traits.h: Add support for type_identity --- include/etl/generators/type_traits_generator.h | 11 +++++++++++ include/etl/type_traits.h | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/etl/generators/type_traits_generator.h b/include/etl/generators/type_traits_generator.h index 35db7ea62..c1d73d103 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 93730e5a3..1a40f0264 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