diff --git a/include/etl/generators/type_traits_generator.h b/include/etl/generators/type_traits_generator.h index 8d74b511..8546198f 100644 --- a/include/etl/generators/type_traits_generator.h +++ b/include/etl/generators/type_traits_generator.h @@ -716,26 +716,31 @@ namespace etl ///\ingroup type_traits /// Implemented by checking if type is convertable to an integer thru static_cast - namespace private_type_traits { - + namespace private_type_traits + { // Base case template - struct is_convertible_to_int : false_type {}; + struct is_convertible_to_int : false_type + { + }; // Selected if `static_cast(declval())` is a valid statement // 2nd template argument of base case defaults to int to ensure that this partial specialization is always tried first template - struct is_convertible_to_int< - T, decltype(static_cast(declval()))> - : true_type {}; + struct is_convertible_to_int(declval()))> + : true_type + { + }; + } - } // namespace private_type_traits template struct is_enum : integral_constant::value && - !is_class::value && - !is_arithmetic::value && - !is_reference::value> {}; + !is_class::value && + !is_arithmetic::value && + !is_reference::value> + { + }; #if ETL_USING_CPP17 template diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index adb67f9b..03aa822c 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -704,26 +704,31 @@ namespace etl ///\ingroup type_traits /// Implemented by checking if type is convertable to an integer thru static_cast - namespace private_type_traits { - + namespace private_type_traits + { // Base case template - struct is_convertible_to_int : false_type {}; + struct is_convertible_to_int : false_type + { + }; // Selected if `static_cast(declval())` is a valid statement // 2nd template argument of base case defaults to int to ensure that this partial specialization is always tried first template - struct is_convertible_to_int< - T, decltype(static_cast(declval()))> - : true_type {}; + struct is_convertible_to_int(declval()))> + : true_type + { + }; + } - } // namespace private_type_traits template struct is_enum : integral_constant::value && - !is_class::value && - !is_arithmetic::value && - !is_reference::value> {}; + !is_class::value && + !is_arithmetic::value && + !is_reference::value> + { + }; #if ETL_USING_CPP17 template diff --git a/support/Release notes.txt b/support/Release notes.txt index 1d2e0017..28d946d5 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -2,6 +2,7 @@ 20.31.0 Added etl::poly_span Refacted parts of etl::span, including prevent compound statements in constexpr methods for C++11 +Added etl::is_enum =============================================================================== 20.30.1