From b6db4195a31bfaa06d5f0084f915151fa4f4946b Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 9 Mar 2024 12:03:52 +0000 Subject: [PATCH] Refactored etl::is_default_constructible definition --- include/etl/type_traits.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 84c6b279..7e9ac31f 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -1635,11 +1635,6 @@ typedef integral_constant true_type; template using is_constructible = std::is_constructible; - //********************************************* - // is_default_constructible - template - using is_default_constructible = std::is_default_constructible; - //********************************************* // is_copy_constructible template @@ -1877,14 +1872,6 @@ typedef integral_constant true_type; }; #endif - //********************************************* - // is_default_constructible - template - struct is_default_constructible : etl::false_type { }; - - template - struct is_default_constructible> : etl::true_type { }; - //********************************************* // is_copy_constructible template ::value || etl::is_pointer::value> @@ -2083,6 +2070,24 @@ typedef integral_constant true_type; { }; +#if ETL_USING_CPP11 + //********************************************* + // is_default_constructible + template + struct is_default_constructible + : etl::false_type { }; + + template + struct is_default_constructible> + : etl::true_type { }; +#else + template + struct is_default_constructible + : public etl::bool_constant::value || etl::is_pointer::value> + { + }; +#endif + #if ETL_USING_CPP17 template