diff --git a/include/etl/generators/type_traits_generator.h b/include/etl/generators/type_traits_generator.h index 2eaa99e8..36a7e4c4 100644 --- a/include/etl/generators/type_traits_generator.h +++ b/include/etl/generators/type_traits_generator.h @@ -111,23 +111,11 @@ namespace etl template const T integral_constant::value; -#if ETL_CPP17_SUPPORTED +#if ETL_CPP11_SUPPORTED template using bool_constant = integral_constant; #endif - //*************************************************************************** - /// bool_constant - template - struct bool_constant :etl::integral_constant - { - }; - -#if ETL_CPP17_SUPPORTED - template - inline constexpr bool bool_constant_v = bool_constant::value; -#endif - //*************************************************************************** /// negation template @@ -813,6 +801,16 @@ namespace etl using bool_constant = std::bool_constant; #endif +#if ETTL_CPP17_SUPPORTED + template + struct negation : std::negation + { + }; + + template + inline constexpr bool negation_v = std::negation_v; +#endif + //*************************************************************************** /// remove_reference ///\ingroup type_traits @@ -1563,11 +1561,8 @@ namespace etl { private: - template - struct index_of_helper; - - template - struct index_of_helper + template + struct index_of_helper { enum { @@ -1575,8 +1570,8 @@ namespace etl }; }; - template - struct index_of_helper + template + struct index_of_helper { enum { @@ -1590,7 +1585,7 @@ namespace etl enum { - value = etl::is_one_of::value ? private_type_traits::index_of_helper::value - 1 : npos + value = etl::is_one_of::value ? index_of_helper::value - 1 : npos }; }; } diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 53a2ce7c..d6c72303 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -99,23 +99,11 @@ namespace etl template const T integral_constant::value; -#if ETL_CPP17_SUPPORTED +#if ETL_CPP11_SUPPORTED template using bool_constant = integral_constant; #endif - //*************************************************************************** - /// bool_constant - template - struct bool_constant :etl::integral_constant - { - }; - -#if ETL_CPP17_SUPPORTED - template - inline constexpr bool bool_constant_v = bool_constant::value; -#endif - //*************************************************************************** /// negation template @@ -801,6 +789,16 @@ namespace etl using bool_constant = std::bool_constant; #endif +#if ETTL_CPP17_SUPPORTED + template + struct negation : std::negation + { + }; + + template + inline constexpr bool negation_v = std::negation_v; +#endif + //*************************************************************************** /// remove_reference ///\ingroup type_traits @@ -1556,11 +1554,8 @@ namespace etl { private: - template - struct index_of_helper; - - template - struct index_of_helper + template + struct index_of_helper { enum { @@ -1568,8 +1563,8 @@ namespace etl }; }; - template - struct index_of_helper + template + struct index_of_helper { enum { @@ -1583,7 +1578,7 @@ namespace etl enum { - value = etl::is_one_of::value ? private_type_traits::index_of_helper::value - 1 : npos + value = etl::is_one_of::value ? index_of_helper::value - 1 : npos }; }; }