Refactored etl::is_default_constructible definition

This commit is contained in:
John Wellbelove 2024-03-09 12:03:52 +00:00
parent 40326db14c
commit b6db4195a3

View File

@ -1635,11 +1635,6 @@ typedef integral_constant<bool, true> true_type;
template<typename T, typename... TArgs>
using is_constructible = std::is_constructible<T, TArgs...>;
//*********************************************
// is_default_constructible
template<typename T, typename... TArgs>
using is_default_constructible = std::is_default_constructible<T>;
//*********************************************
// is_copy_constructible
template <typename T>
@ -1877,14 +1872,6 @@ typedef integral_constant<bool, true> true_type;
};
#endif
//*********************************************
// is_default_constructible
template<typename T, typename = void>
struct is_default_constructible : etl::false_type { };
template<typename T>
struct is_default_constructible<T, etl::void_t<decltype(T())>> : etl::true_type { };
//*********************************************
// is_copy_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
@ -2083,6 +2070,24 @@ typedef integral_constant<bool, true> true_type;
{
};
#if ETL_USING_CPP11
//*********************************************
// is_default_constructible
template<typename T, typename = void>
struct is_default_constructible
: etl::false_type { };
template<typename T>
struct is_default_constructible<T, etl::void_t<decltype(T())>>
: etl::true_type { };
#else
template <typename T>
struct is_default_constructible
: public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
#endif
#if ETL_USING_CPP17
template <typename T1, typename T2>