Minor tweak to conditional_integral_constant

This commit is contained in:
John Wellbelove 2017-12-05 18:47:20 +00:00
parent e3c6865bd1
commit 636554812f
2 changed files with 12 additions and 7 deletions

View File

@ -54,6 +54,7 @@ SOFTWARE.
#define __ETL_TYPE_TRAITS__
#include <stddef.h>
#include <stdint.h>
#include "platform.h"
#include "nullptr.h"
@ -334,7 +335,7 @@ namespace etl
struct conditional_integral_constant<false, T, TRUE_VALUE, FALSE_VALUE>
{
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
static const T value = FALSE_VALUE;
static const T value = FALSE_VALUE;
};
/// make_signed
@ -484,14 +485,14 @@ namespace etl
///\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 =
static const bool value =
etl::is_same<T, T1>::value ||
etl::is_same<T, T2>::value ||
etl::is_same<T, T3>::value ||

View File

@ -66,6 +66,7 @@ cog.outl("//********************************************************************
#define __ETL_TYPE_TRAITS__
#include <stddef.h>
#include <stdint.h>
#include "platform.h"
#include "nullptr.h"
@ -333,7 +334,10 @@ namespace etl
/// conditional_integral_constant
///\ingroup type_traits
template <bool B, typename T, T TRUE_VALUE, T FALSE_VALUE>
struct conditional_integral_constant
struct conditional_integral_constant;
template <typename T, T TRUE_VALUE, T FALSE_VALUE>
struct conditional_integral_constant<true, T, TRUE_VALUE, FALSE_VALUE>
{
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
static const T value = TRUE_VALUE;