Keil ARM5 fixes

This commit is contained in:
John Wellbelove 2020-10-27 13:01:35 +00:00
parent 4d8f7f4943
commit 05d033ce3a
2 changed files with 11 additions and 4 deletions

View File

@ -749,11 +749,16 @@ namespace etl
auto nonvoid_convertible(...)->etl::false_type;
}
#if defined(ETL_COMPILER_ARM5)
template <typename TFrom, typename TTo>
struct is_convertible : etl::integral_constant<bool, __is_convertible_to(TFrom, TTo)> {};
#else
template <typename TFrom, typename TTo>
struct is_convertible : etl::integral_constant<bool, (decltype(private_type_traits::returnable<TTo>(0))::value &&
decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
(etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
#endif
#endif
#if ETL_CPP17_SUPPORTED
template <typename TFrom, typename TTo >
@ -763,7 +768,7 @@ namespace etl
//***************************************************************************
/// Alignment templates.
/// These require compiler specific intrinsics.
#if ETL_CPP11_SUPPORTED
#if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5)
template <typename T> struct alignment_of : integral_constant<size_t, alignof(T)> { };
#elif ETL_COMPILER_MICROSOFT
template <typename T> struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
@ -1075,11 +1080,12 @@ namespace etl
//***************************************************************************
/// is_pod
///\ingroup type_traits
template <typename T> struct is_pod : std::is_pod<T> {};
template <typename T>
struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_pod_v = std::is_pod_v<T>;
inline constexpr bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
#endif
#if !defined(ARDUINO) && ETL_NOT_USING_STLPORT

View File

@ -736,8 +736,9 @@ namespace etl
template <typename, typename>
auto nonvoid_convertible(...)->etl::false_type;
}
#if defined(ETL_COMPILER_ARM5)
template <typename TFrom, typename TTo>
template <typename TFrom, typename TTo>
struct is_convertible : etl::integral_constant<bool, __is_convertible_to(TFrom, TTo)> {};
#else
template <typename TFrom, typename TTo>