Merge remote-tracking branch 'origin/hotfix/type_traits_is_rvalue_reference' into development

# Conflicts:
#	include/etl/type_traits.h
This commit is contained in:
John Wellbelove 2020-03-18 14:31:48 +00:00
parent 51298be2e4
commit c5ee3ec0ab
7 changed files with 45 additions and 18 deletions

View File

@ -37,7 +37,7 @@ namespace etl
{
//***************************************************************************
///\ingroup mutex
///\brief This mutex class is implemented using ETLSTD::mutex.
///\brief This mutex class is implemented using std::mutex.
//***************************************************************************
class mutex
{

View File

@ -739,7 +739,7 @@ namespace etl
inline constexpr size_t alignment_of_v = etl::alignment_of<T>::value;
#endif
#else // defined(ETL_NO_STL) || !ETL_CPP11_SUPPORTED
#else // Condition = !defined(ETL_NO_STL) && ETL_CPP11_SUPPORTED
//*****************************************************************************
// Traits are derived from the STL
@ -1006,11 +1006,11 @@ namespace etl
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED
template<typename T> struct is_rvalue_reference : std::is_rvalue_reference<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>;
#endif
#endif
//***************************************************************************
@ -1273,7 +1273,7 @@ namespace etl
inline constexpr size_t alignment_of_v = std::alignment_of_v<T>;
#endif
#endif // defined(ETL_NO_STL) || !ETL_CPP11_SUPPORTED
#endif // Condition = !defined(ETL_NO_STL) && ETL_CPP11_SUPPORTED
//***************************************************************************
// ETL extended type traits.
@ -1308,7 +1308,7 @@ namespace etl
struct is_one_of
{
static const bool value = etl::is_same<T, T1>::value ||
etl::is_one_of<T, TRest...>::value;
etl::is_one_of<T, TRest...>::value;
};
template <typename T, typename T1>
@ -1321,10 +1321,11 @@ namespace etl
/// Template to determine if a type is one of a specified list.
///\ingroup types
template <typename T,
typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void,
typename T9 = void, typename T10 = void, typename T11 = void, typename T12 = void,
typename T13 = void, typename T14 = void, typename T15 = void, typename T16 = void>
typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void,
typename T9 = void, typename T10 = void, typename T11 = void, typename T12 = void,
typename T13 = void, typename T14 = void, typename T15 = void, typename T16 = void,
typename T17 = void>
struct is_one_of
{
static const bool value =

View File

@ -413,6 +413,7 @@ namespace etl
inline constexpr bool is_lvalue_reference_v = etl::is_lvalue_reference<T>::value;
#endif
#if ETL_CPP11_SUPPORTED
//***************************************************************************
/// is_rvalue_reference
template<typename T> struct is_rvalue_reference_helper : false_type {};
@ -422,6 +423,7 @@ namespace etl
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_rvalue_reference_v = etl::is_rvalue_reference<T>::value;
#endif
#endif
//***************************************************************************
@ -749,7 +751,7 @@ namespace etl
inline constexpr size_t alignment_of_v = etl::alignment_of<T>::value;
#endif
#else // defined(ETL_NO_STL) || !ETL_CPP11_SUPPORTED
#else // Condition = !defined(ETL_NO_STL) && ETL_CPP11_SUPPORTED
//*****************************************************************************
// Traits are derived from the STL
@ -1016,11 +1018,11 @@ namespace etl
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED
template<typename T> struct is_rvalue_reference : std::is_rvalue_reference<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>;
#endif
#endif
//***************************************************************************
@ -1283,7 +1285,7 @@ namespace etl
inline constexpr size_t alignment_of_v = std::alignment_of_v<T>;
#endif
#endif // defined(ETL_NO_STL) || !ETL_CPP11_SUPPORTED
#endif // Condition = !defined(ETL_NO_STL) && ETL_CPP11_SUPPORTED
//***************************************************************************
// ETL extended type traits.
@ -1318,7 +1320,7 @@ namespace etl
struct is_one_of
{
static const bool value = etl::is_same<T, T1>::value ||
etl::is_one_of<T, TRest...>::value;
etl::is_one_of<T, TRest...>::value;
};
template <typename T, typename T1>
@ -1345,8 +1347,8 @@ namespace etl
cog.outl("{")
cog.outl(" static const bool value = ")
for n in range(1, int(IsOneOf)):
cog.outl(" etlstd::is_same<T, T%s>::value ||" % n)
cog.outl(" etlstd::is_same<T, T%s>::value;" % IsOneOf)
cog.outl(" etl::is_same<T, T%s>::value ||" % n)
cog.outl(" etl::is_same<T, T%s>::value;" % IsOneOf)
cog.outl("};")
]]]*/
/*[[[end]]]*/
@ -1377,6 +1379,10 @@ namespace etl
typedef type_t* pointer;
typedef const type_t* const_pointer;
typedef const type_t* const const_pointer_const;
#if ETL_CPP11_SUPPORTED
typedef type_t&& rvalue_reference;
#endif
};
// Pointers.
@ -1395,6 +1401,10 @@ namespace etl
typedef type_t* pointer;
typedef const type_t* const_pointer;
typedef const type_t* const const_pointer_const;
#if ETL_CPP11_SUPPORTED
typedef type_t&& rvalue_reference;
#endif
};
// Pointers.
@ -1413,6 +1423,10 @@ namespace etl
typedef type_t* pointer;
typedef const type_t* const_pointer;
typedef const type_t* const const_pointer_const;
#if ETL_CPP11_SUPPORTED
typedef type_t&& rvalue_reference;
#endif
};
// References.
@ -1431,6 +1445,10 @@ namespace etl
typedef type_t* pointer;
typedef const type_t* const_pointer;
typedef const type_t* const const_pointer_const;
#if ETL_CPP11_SUPPORTED
typedef type_t&& rvalue_reference;
#endif
};
#if ETL_CPP11_SUPPORTED
@ -1450,6 +1468,10 @@ namespace etl
typedef type_t* pointer;
typedef const type_t* const_pointer;
typedef const type_t* const const_pointer_const;
#if ETL_CPP11_SUPPORTED
typedef type_t&& rvalue_reference;
#endif
};
#endif

View File

@ -39,7 +39,7 @@ SOFTWARE.
#define ETL_VERSION_MAJOR 16
#define ETL_VERSION_MINOR 5
#define ETL_VERSION_PATCH 2
#define ETL_VERSION_PATCH 3
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH)

View File

@ -1,6 +1,6 @@
{
"name": "Embedded Template Library",
"version": "16.5.2",
"version": "16.5.3",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=16.5.2
version=16.5.3
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT

View File

@ -1,3 +1,7 @@
===============================================================================
16.5.3
type_traits.h is_one_of fix for C++03
===============================================================================
16.5.2
Modified nullptr.h for better cross compiler compatibility