Updated type_traits_generator

This commit is contained in:
John Wellbelove 2019-12-19 20:01:15 +00:00
parent e2e2b58eec
commit 7609f72447

View File

@ -255,8 +255,7 @@ namespace etl
///\ingroup type_traits
template <typename T> struct is_fundamental : integral_constant<bool, is_arithmetic<T>::value ||
is_void<T>::value ||
is_same<std::nullptr_t,
typename remove_cv<T>::type>::value> {};
is_same<std::nullptr_t, typename remove_cv<T>::type>::value> {};
/// is_compound
///\ingroup type_traits
@ -270,25 +269,27 @@ namespace etl
/// is_pointer
///\ingroup type_traits
template <typename T> struct is_pointer : false_type {};
template <typename T> struct is_pointer<T*> : true_type {};
template<typename T> struct is_pointer_helper : false_type {};
template<typename T> struct is_pointer_helper<T*> : true_type {};
template<typename T> struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
/// is_reference
///\ingroup type_traits
template <typename T> struct is_reference : false_type {};
template <typename T> struct is_reference<T&> : true_type {};
template<typename T> struct is_reference_helper : false_type {};
template<typename T> struct is_reference_helper<T&> : true_type {};
template<typename T> struct is_reference : is_reference_helper<typename remove_cv<T>::type> {};
/// is_pod
/// For C++03, only fundamental and pointers types are recognised.
///\ingroup type_traits
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO) && !defined(ETL_STLPORT)) && !defined(ETL_IN_UNIT_TEST) && !defined(ETL_NO_STL)
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO) && !defined(ETL_STLPORT)) && !defined(IN_TYPE_TRAITS_TEST) && !defined(ETL_NO_STL)
// For compilers that support C++11
template <typename T> struct is_pod : std::is_pod<T> {};
#else
template <typename T> struct is_pod : etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
#endif
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) && !defined(ETL_STLPORT) && !defined(ETL_IN_UNIT_TEST) && !defined(ETL_NO_STL)
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) && !defined(ETL_STLPORT) && !defined(IN_TYPE_TRAITS_TEST) && !defined(ETL_NO_STL)
/// is_trivially_constructible
///\ingroup type_traits
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
@ -304,6 +305,10 @@ namespace etl
/// is_trivially_copy_assignable
///\ingroup type_traits
template <typename T> struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
/// is_trivially_copyable
///\ingroup type_traits
template <typename T> struct is_trivially_copyable : std::is_trivially_copyable<T> {};
#else
/// is_trivially_constructible
/// For C++03, only POD types are recognised.
@ -324,6 +329,11 @@ namespace etl
/// For C++03, only POD types are recognised.
///\ingroup type_traits
template <typename T> struct is_trivially_copy_assignable : etl::is_pod<T> {};
/// is_trivially_copyable
/// For C++03, only POD types are recognised.
///\ingroup type_traits
template <typename T> struct is_trivially_copyable : etl::is_pod<T> {};
#endif
#if ETL_CPP11_SUPPORTED