mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-28 21:38:44 +08:00
Merge remote-tracking branch 'origin/development'
This commit is contained in:
parent
2ce91a95ec
commit
60fb58049d
@ -116,7 +116,7 @@ namespace etl
|
||||
template <typename T>
|
||||
operator T& ()
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
T* t = *this;
|
||||
return *t;
|
||||
}
|
||||
@ -125,7 +125,7 @@ namespace etl
|
||||
template <typename T>
|
||||
operator const T& () const
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
const T* t = *this;
|
||||
return *t;
|
||||
}
|
||||
@ -134,7 +134,7 @@ namespace etl
|
||||
template <typename T>
|
||||
operator T* ()
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
return reinterpret_cast<T*>(data);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ namespace etl
|
||||
template <typename T>
|
||||
operator const T* () const
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
return reinterpret_cast<const T*>(data);
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T& get_reference()
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
T* t = *this;
|
||||
return *t;
|
||||
}
|
||||
@ -159,7 +159,7 @@ namespace etl
|
||||
template <typename T>
|
||||
const T& get_reference() const
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
const T* t = *this;
|
||||
return *t;
|
||||
}
|
||||
@ -168,7 +168,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T* get_address()
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
return reinterpret_cast<T*>(data);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ namespace etl
|
||||
template <typename T>
|
||||
const T* get_address() const
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_same<T*, void*>:: value || ((ALIGNMENT % etl::alignment_of<T>::value) == 0)), "Incompatible alignment");
|
||||
return reinterpret_cast<const T*>(data);
|
||||
}
|
||||
|
||||
|
||||
@ -649,7 +649,7 @@ namespace etl
|
||||
template <std::size_t I, typename T, std::size_t MAXN>
|
||||
inline T& get(array<T, MAXN>& a)
|
||||
{
|
||||
STATIC_ASSERT(I < MAXN, "Index out of bounds");
|
||||
ETL_STATIC_ASSERT(I < MAXN, "Index out of bounds");
|
||||
return a[I];
|
||||
}
|
||||
|
||||
@ -664,7 +664,7 @@ namespace etl
|
||||
template <std::size_t I, typename T, std::size_t MAXN>
|
||||
inline const T& get(const array<T, MAXN>& a)
|
||||
{
|
||||
STATIC_ASSERT(I < MAXN, "Index out of bounds");
|
||||
ETL_STATIC_ASSERT(I < MAXN, "Index out of bounds");
|
||||
return a[I];
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Only integral types are supported");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Only integral types are supported");
|
||||
|
||||
atomic()
|
||||
: value(0)
|
||||
|
||||
@ -108,7 +108,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T rotate_left(T value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
const size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1;
|
||||
|
||||
@ -121,7 +121,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T rotate_left(T value, size_t distance)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
const size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
|
||||
distance %= BITS;
|
||||
@ -136,7 +136,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T rotate_right(T value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
const size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1;
|
||||
|
||||
@ -149,7 +149,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T rotate_right(T value, size_t distance)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
const size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
|
||||
distance %= BITS;
|
||||
@ -165,7 +165,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T rotate(T value, typename etl::make_signed<size_t>::type distance)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
T result;
|
||||
|
||||
@ -215,7 +215,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T binary_to_gray(T value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
return (value >> 1) ^ value;
|
||||
}
|
||||
@ -268,7 +268,7 @@ namespace etl
|
||||
template <typename TReturn, const size_t NBITS, typename TValue>
|
||||
TReturn fold_bits(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(integral_limits<TReturn>::bits >= NBITS, "Return type too small to hold result");
|
||||
ETL_STATIC_ASSERT(integral_limits<TReturn>::bits >= NBITS, "Return type too small to hold result");
|
||||
|
||||
const TValue mask = etl::power<2, NBITS>::value - 1;
|
||||
const size_t shift = NBITS;
|
||||
@ -296,10 +296,10 @@ namespace etl
|
||||
template <typename TReturn, const size_t NBITS, typename TValue>
|
||||
TReturn sign_extend(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
ETL_STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
|
||||
struct S
|
||||
{
|
||||
@ -317,11 +317,11 @@ namespace etl
|
||||
template <typename TReturn, const size_t NBITS, const size_t SHIFT, typename TValue>
|
||||
TReturn sign_extend(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
STATIC_ASSERT(SHIFT <= std::numeric_limits<TReturn>::digits, "SHIFT too large");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
ETL_STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
ETL_STATIC_ASSERT(SHIFT <= std::numeric_limits<TReturn>::digits, "SHIFT too large");
|
||||
|
||||
struct S
|
||||
{
|
||||
@ -338,9 +338,9 @@ namespace etl
|
||||
template <typename TReturn, typename TValue>
|
||||
TReturn sign_extend(TValue value, const size_t NBITS)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
|
||||
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
|
||||
|
||||
@ -358,9 +358,9 @@ namespace etl
|
||||
template <typename TReturn, typename TValue>
|
||||
TReturn sign_extend(TValue value, const size_t NBITS, const size_t SHIFT)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
|
||||
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
|
||||
|
||||
@ -443,8 +443,8 @@ namespace etl
|
||||
{
|
||||
private:
|
||||
|
||||
STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
STATIC_ASSERT(VALUE <= etl::integral_limits<typename etl::make_unsigned<TValue>::type>::max, "Value is too large for specified type");
|
||||
ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
ETL_STATIC_ASSERT(VALUE <= etl::integral_limits<typename etl::make_unsigned<TValue>::type>::max, "Value is too large for specified type");
|
||||
|
||||
typedef typename etl::make_unsigned<TResult>::type unsigned_r_t;
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
|
||||
@ -472,7 +472,7 @@ namespace etl
|
||||
template <typename TValue>
|
||||
static TResult value(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
|
||||
|
||||
|
||||
@ -669,7 +669,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed");
|
||||
ETL_STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed");
|
||||
|
||||
//*******************************************
|
||||
/// Constructor.
|
||||
|
||||
@ -34,7 +34,7 @@ SOFTWARE.
|
||||
#include "type_traits.h"
|
||||
#include "binary.h"
|
||||
|
||||
STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
|
||||
///\defgroup frame_check_sequence Frame check sequence calculation
|
||||
///\ingroup maths
|
||||
@ -54,7 +54,7 @@ namespace etl
|
||||
typedef TPolicy policy_type;
|
||||
typedef typename policy_type::value_type value_type;
|
||||
|
||||
STATIC_ASSERT(etl::is_unsigned<value_type>::value, "Signed frame check type not supported");
|
||||
ETL_STATIC_ASSERT(etl::is_unsigned<value_type>::value, "Signed frame check type not supported");
|
||||
|
||||
//*************************************************************************
|
||||
/// Default constructor.
|
||||
@ -72,7 +72,7 @@ namespace etl
|
||||
template<typename TIterator>
|
||||
frame_check_sequence(TIterator begin, const TIterator end)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
|
||||
reset();
|
||||
add(begin, end);
|
||||
@ -94,7 +94,7 @@ namespace etl
|
||||
template<typename TIterator>
|
||||
void add(TIterator begin, const TIterator end)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
|
||||
while (begin != end)
|
||||
{
|
||||
|
||||
@ -97,7 +97,7 @@ namespace etl
|
||||
template <>
|
||||
struct hash <bool>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(bool), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(bool), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(bool v) const
|
||||
{
|
||||
@ -112,7 +112,7 @@ namespace etl
|
||||
template <>
|
||||
struct hash<char>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(char), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(char), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(char v) const
|
||||
{
|
||||
@ -127,7 +127,7 @@ namespace etl
|
||||
template<> struct
|
||||
hash<signed char>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(signed char), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(signed char), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(signed char v) const
|
||||
{
|
||||
@ -142,7 +142,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<unsigned char>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned char), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned char), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(unsigned char v) const
|
||||
{
|
||||
@ -157,7 +157,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<wchar_t>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(wchar_t), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(wchar_t), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(wchar_t v) const
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<short>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(short), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(short), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(short v) const
|
||||
{
|
||||
@ -187,7 +187,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<unsigned short>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned short), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned short), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(unsigned short v) const
|
||||
{
|
||||
@ -202,7 +202,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<int>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(int), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(int), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(int v) const
|
||||
{
|
||||
@ -217,7 +217,7 @@ namespace etl
|
||||
template<>
|
||||
struct hash<unsigned int>
|
||||
{
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned int), "size_t smaller than type");
|
||||
ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned int), "size_t smaller than type");
|
||||
|
||||
size_t operator ()(unsigned int v) const
|
||||
{
|
||||
|
||||
@ -160,7 +160,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_int_type
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_int_for_bits<etl::integral_limits<typename etl::make_signed<T>::type>::bits + 1>::type type;
|
||||
};
|
||||
@ -173,7 +173,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_uint_type
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_uint_for_bits<etl::integral_limits<typename etl::make_unsigned<T>::type>::bits + 1>::type type;
|
||||
};
|
||||
@ -190,7 +190,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_type<T, false>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_uint_for_bits<etl::integral_limits<T>::bits + 1>::type type;
|
||||
};
|
||||
@ -198,7 +198,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_type<T, true>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_int_for_bits<etl::integral_limits<T>::bits + 1>::type type;
|
||||
};
|
||||
|
||||
@ -208,7 +208,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_int_type
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_int_for_bits<etl::integral_limits<typename etl::make_signed<T>::type>::bits + 1>::type type;
|
||||
};
|
||||
@ -221,7 +221,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_uint_type
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_uint_for_bits<etl::integral_limits<typename etl::make_unsigned<T>::type>::bits + 1>::type type;
|
||||
};
|
||||
@ -238,7 +238,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_type<T, false>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_uint_for_bits<etl::integral_limits<T>::bits + 1>::type type;
|
||||
};
|
||||
@ -246,7 +246,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct larger_type<T, true>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Must be an integral type");
|
||||
|
||||
typedef typename etl::smallest_int_for_bits<etl::integral_limits<T>::bits + 1>::type type;
|
||||
};
|
||||
|
||||
@ -286,7 +286,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -472,7 +472,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -655,7 +655,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -835,7 +835,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1011,7 +1011,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1184,7 +1184,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1354,7 +1354,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1521,7 +1521,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1684,7 +1684,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -1844,7 +1844,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2000,7 +2000,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2153,7 +2153,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2302,7 +2302,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2448,7 +2448,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2591,7 +2591,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
@ -2731,7 +2731,7 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit message_packet(const T& msg)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1>::value), "Unsupported type for this message packet");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1>::value), "Unsupported type for this message packet");
|
||||
|
||||
void* p = data;
|
||||
::new (p) T(static_cast<const T&>(msg));
|
||||
|
||||
@ -294,7 +294,7 @@ namespace etl
|
||||
cog.outl(" template <typename T>")
|
||||
cog.outl(" explicit message_packet(const T& msg)")
|
||||
cog.outl(" {")
|
||||
cog.out(" STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out(" ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(Handlers)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -479,7 +479,7 @@ namespace etl
|
||||
cog.outl(" template <typename T>")
|
||||
cog.outl(" explicit message_packet(const T& msg)")
|
||||
cog.outl(" {")
|
||||
cog.out(" STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out(" ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for t in range(1, n):
|
||||
cog.out("T%s, " % t)
|
||||
if t % 16 == 0:
|
||||
|
||||
@ -646,7 +646,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed");
|
||||
ETL_STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed");
|
||||
|
||||
//*******************************************
|
||||
/// Constructor.
|
||||
|
||||
@ -57,7 +57,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
STATIC_ASSERT((etl::is_same<THash, uint32_t>::value || etl::is_same<THash, uint64_t>::value), "Only 32 & 64 bit types supported");
|
||||
ETL_STATIC_ASSERT((etl::is_same<THash, uint32_t>::value || etl::is_same<THash, uint64_t>::value), "Only 32 & 64 bit types supported");
|
||||
|
||||
typedef THash value_type;
|
||||
|
||||
@ -81,7 +81,7 @@ namespace etl
|
||||
murmur3(TIterator begin, const TIterator end, value_type seed_ = 0)
|
||||
: seed(seed_)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
|
||||
reset();
|
||||
while (begin != end)
|
||||
@ -119,7 +119,7 @@ namespace etl
|
||||
template<typename TIterator>
|
||||
void add(TIterator begin, const TIterator end)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised));
|
||||
|
||||
while (begin != end)
|
||||
|
||||
@ -67,14 +67,6 @@ namespace std
|
||||
// Can't take address of nullptr.
|
||||
void operator&() const;
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
/// A null pointer.
|
||||
///\ingroup nullptr
|
||||
//*****************************************************************************
|
||||
#if !defined(ETL_STLPORT)
|
||||
const nullptr_t nullptr = { };
|
||||
#endif
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
||||
@ -62,9 +62,9 @@ namespace etl
|
||||
template <typename T>
|
||||
explicit packet(const T& value)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_base_of<TBase, T>::value), "Unsupported type");
|
||||
STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size");
|
||||
STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT, "Unsupported alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_base_of<TBase, T>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT, "Unsupported alignment");
|
||||
|
||||
::new (static_cast<T*>(data)) T(value);
|
||||
}
|
||||
@ -84,9 +84,9 @@ namespace etl
|
||||
template <typename T>
|
||||
packet& operator =(const T& value)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_base_of<TBase, T>::value), "Unsupported type");
|
||||
STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size");
|
||||
STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT, "Unsupported alignment");
|
||||
ETL_STATIC_ASSERT((etl::is_base_of<TBase, T>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT, "Unsupported alignment");
|
||||
|
||||
static_cast<TBase*>(data)->~TBase();
|
||||
::new (static_cast<T*>(data)) T(value);
|
||||
|
||||
@ -40,7 +40,7 @@ SOFTWARE.
|
||||
#include "array.h"
|
||||
#include "container.h"
|
||||
|
||||
STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
|
||||
#if defined(ETL_COMPILER_KEIL)
|
||||
#pragma diag_suppress 1300
|
||||
@ -87,7 +87,7 @@ namespace etl
|
||||
pearson(TIterator begin, const TIterator end)
|
||||
: first(true)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
|
||||
reset();
|
||||
add(begin, end);
|
||||
@ -109,7 +109,7 @@ namespace etl
|
||||
template<typename TIterator>
|
||||
void add(TIterator begin, const TIterator end)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
|
||||
|
||||
while (begin != end)
|
||||
{
|
||||
|
||||
@ -494,8 +494,8 @@ namespace etl
|
||||
template <typename U>
|
||||
U* allocate()
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::allocate<U>();
|
||||
}
|
||||
|
||||
@ -508,8 +508,8 @@ namespace etl
|
||||
template <typename U>
|
||||
U* create()
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>();
|
||||
}
|
||||
|
||||
@ -521,8 +521,8 @@ namespace etl
|
||||
template <typename U, typename T1>
|
||||
U* create(const T1& value1)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>(value1);
|
||||
}
|
||||
|
||||
@ -534,8 +534,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2>
|
||||
U* create(const T1& value1, const T2& value2)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>(value1, value2);
|
||||
}
|
||||
|
||||
@ -547,8 +547,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2, typename T3>
|
||||
U* create(const T1& value1, const T2& value2, const T3& value3)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>(value1, value2, value3);
|
||||
}
|
||||
|
||||
@ -560,8 +560,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2, typename T3, typename T4>
|
||||
U* create(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>(value1, value2, value3, value4);
|
||||
}
|
||||
#else
|
||||
@ -571,8 +571,8 @@ namespace etl
|
||||
template <typename U, typename... Args>
|
||||
U* create(Args&&... args)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return ipool::create<U>(std::forward<Args>(args)...);
|
||||
}
|
||||
#endif
|
||||
@ -585,8 +585,8 @@ namespace etl
|
||||
template <typename U>
|
||||
void destroy(const void* const p_object)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT_, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
reinterpret_cast<U*>((const_cast<void*>(p_object)))->~U();
|
||||
ipool::release(p_object);
|
||||
}
|
||||
@ -645,8 +645,8 @@ namespace etl
|
||||
template <typename U>
|
||||
U* allocate()
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template allocate<U>();
|
||||
}
|
||||
|
||||
@ -659,8 +659,8 @@ namespace etl
|
||||
template <typename U>
|
||||
U* create()
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>();
|
||||
}
|
||||
|
||||
@ -672,8 +672,8 @@ namespace etl
|
||||
template <typename U, typename T1>
|
||||
U* create(const T1& value1)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>(value1);
|
||||
}
|
||||
|
||||
@ -685,8 +685,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2>
|
||||
U* create(const T1& value1, const T2& value2)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>(value1, value2);
|
||||
}
|
||||
|
||||
@ -698,8 +698,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2, typename T3>
|
||||
U* create(const T1& value1, const T2& value2, const T3& value3)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>(value1, value2, value3);
|
||||
}
|
||||
|
||||
@ -711,8 +711,8 @@ namespace etl
|
||||
template <typename U, typename T1, typename T2, typename T3, typename T4>
|
||||
U* create(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>(value1, value2, value3, value4);
|
||||
}
|
||||
#else
|
||||
@ -724,8 +724,8 @@ namespace etl
|
||||
template <typename U, typename... Args>
|
||||
U* create(Args&&... args)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
return base_t::template create<U>(std::forward<Args>(args)...);
|
||||
}
|
||||
#endif
|
||||
@ -738,8 +738,8 @@ namespace etl
|
||||
template <typename U>
|
||||
void destroy(const void* const p_object)
|
||||
{
|
||||
STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
ETL_STATIC_ASSERT(etl::alignment_of<U>::value <= ALIGNMENT, "Type has incompatible alignment");
|
||||
ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool");
|
||||
reinterpret_cast<U*>((const_cast<void*>(p_object)))->~U();
|
||||
base_t::release(p_object);
|
||||
}
|
||||
|
||||
@ -522,7 +522,7 @@ namespace etl
|
||||
template <typename TIterator>
|
||||
void assign(TIterator first, TIterator last)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<value_type, typename std::iterator_traits<TIterator>::value_type>::value), "Incompatible data for assign");
|
||||
ETL_STATIC_ASSERT((etl::is_same<value_type, typename std::iterator_traits<TIterator>::value_type>::value), "Incompatible data for assign");
|
||||
|
||||
#if defined(ETL_DEBUG)
|
||||
difference_type d = std::distance(first, last);
|
||||
|
||||
@ -26,26 +26,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ETL_STATIC_ASSERT_INCLUDED
|
||||
#define ETL_STATIC_ASSERT_INCLUDED
|
||||
#ifndef ETL_ETL_STATIC_ASSERT_INCLUDED
|
||||
#define ETL_ETL_STATIC_ASSERT_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#if (ETL_CPP11_SUPPORTED)
|
||||
#define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message)
|
||||
#define ETL_STATIC_ASSERT(Condition, Message) static_assert(Condition, Message)
|
||||
#else
|
||||
template <bool Condition>
|
||||
struct STATIC_ASSERT_FAILED;
|
||||
struct ETL_ETL_STATIC_ASSERT_FAILED;
|
||||
|
||||
template <>
|
||||
struct STATIC_ASSERT_FAILED<true> {};
|
||||
struct ETL_ETL_STATIC_ASSERT_FAILED<true> {};
|
||||
|
||||
#define ETL_SA1(a,b) a##b
|
||||
#define ETL_SA2(a,b) ETL_SA1(a,b)
|
||||
#define STATIC_ASSERT(Condition, Message) \
|
||||
#define ETL_STATIC_ASSERT(Condition, Message) \
|
||||
enum \
|
||||
{ \
|
||||
ETL_SA2(dummy, __LINE__) = sizeof(STATIC_ASSERT_FAILED<(bool)(Condition)>) \
|
||||
ETL_SA2(dummy, __LINE__) = sizeof(ETL_ETL_STATIC_ASSERT_FAILED<(bool)(Condition)>) \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ namespace etl
|
||||
::type>::type>::type>::type>
|
||||
::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), "Invalid id");
|
||||
ETL_STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), "Invalid id");
|
||||
};
|
||||
|
||||
//************************************
|
||||
@ -156,7 +156,7 @@ namespace etl
|
||||
(unsigned int) UNKNOWN
|
||||
};
|
||||
|
||||
STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), "Invalid type");
|
||||
ETL_STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), "Invalid type");
|
||||
};
|
||||
|
||||
//************************************
|
||||
@ -221,7 +221,7 @@ namespace etl
|
||||
etl::null_type<0>>::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), "Invalid type");
|
||||
ETL_STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), "Invalid type");
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.out(" ")
|
||||
cog.outl("")
|
||||
cog.outl(" STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), \"Invalid id\");")
|
||||
cog.outl(" ETL_STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), \"Invalid id\");")
|
||||
cog.outl(" };")
|
||||
cog.outl("")
|
||||
cog.outl(" //************************************")
|
||||
@ -136,7 +136,7 @@ namespace etl
|
||||
cog.outl(" (unsigned int) UNKNOWN")
|
||||
cog.outl(" };")
|
||||
cog.outl("")
|
||||
cog.outl(" STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), \"Invalid type\");")
|
||||
cog.outl(" ETL_STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), \"Invalid type\");")
|
||||
cog.outl(" };")
|
||||
cog.outl("")
|
||||
cog.outl(" //************************************")
|
||||
@ -183,7 +183,7 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.out(" ")
|
||||
cog.outl("")
|
||||
cog.outl(" STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), \"Invalid type\");")
|
||||
cog.outl(" ETL_STATIC_ASSERT(!(etl::is_same<etl::null_type<0>, type>::value), \"Invalid type\");")
|
||||
cog.outl(" };")
|
||||
cog.outl("};")
|
||||
]]]*/
|
||||
|
||||
@ -93,7 +93,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 16, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 16, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -140,7 +140,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 15, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 15, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -185,7 +185,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 14, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 14, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -228,7 +228,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 13, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 13, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -269,7 +269,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 12, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 12, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -308,7 +308,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 11, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 11, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -345,7 +345,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 10, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 10, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -380,7 +380,7 @@ namespace etl
|
||||
::type>::type>::type>::type>::type>::type>::type>::type>
|
||||
::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 9, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 9, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -412,7 +412,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 8, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 8, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -442,7 +442,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 7, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 7, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -470,7 +470,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 6, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 6, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -496,7 +496,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 5, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 5, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -520,7 +520,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 4, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 4, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -542,7 +542,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 3, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 3, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -562,7 +562,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type>::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 2, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 2, "Invalid ID");
|
||||
};
|
||||
};
|
||||
|
||||
@ -580,7 +580,7 @@ namespace etl
|
||||
etl::null_type<0> >
|
||||
::type type;
|
||||
|
||||
STATIC_ASSERT(ID < 1, "Invalid ID");
|
||||
ETL_STATIC_ASSERT(ID < 1, "Invalid ID");
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ namespace etl
|
||||
cog.out(" ")
|
||||
cog.outl("::type type;")
|
||||
cog.outl("");
|
||||
cog.outl(" STATIC_ASSERT(ID < %s, \"Invalid ID\");" % int(NTypes));
|
||||
cog.outl(" ETL_STATIC_ASSERT(ID < %s, \"Invalid ID\");" % int(NTypes));
|
||||
cog.outl(" };")
|
||||
cog.outl("};")
|
||||
|
||||
@ -122,7 +122,7 @@ namespace etl
|
||||
cog.out(" ")
|
||||
cog.outl("::type type;")
|
||||
cog.outl("");
|
||||
cog.outl(" STATIC_ASSERT(ID < %s, \"Invalid ID\");" % s);
|
||||
cog.outl(" ETL_STATIC_ASSERT(ID < %s, \"Invalid ID\");" % s);
|
||||
cog.outl(" };")
|
||||
cog.outl("};")
|
||||
]]]*/
|
||||
|
||||
@ -327,14 +327,14 @@ namespace etl
|
||||
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");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
static const T value = TRUE_VALUE;
|
||||
};
|
||||
|
||||
template <typename T, T TRUE_VALUE, T FALSE_VALUE>
|
||||
struct conditional_integral_constant<false, T, TRUE_VALUE, FALSE_VALUE>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
static const T value = FALSE_VALUE;
|
||||
};
|
||||
|
||||
|
||||
@ -339,14 +339,14 @@ namespace etl
|
||||
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");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
static const T value = TRUE_VALUE;
|
||||
};
|
||||
|
||||
template <typename T, T TRUE_VALUE, T FALSE_VALUE>
|
||||
struct conditional_integral_constant<false, T, TRUE_VALUE, FALSE_VALUE>
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
static const T value = FALSE_VALUE;
|
||||
};
|
||||
|
||||
|
||||
@ -678,12 +678,12 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// Constructor that catches any types that are not supported.
|
||||
/// Forces a STATIC_ASSERT.
|
||||
/// Forces a ETL_STATIC_ASSERT.
|
||||
//***************************************************************************
|
||||
template <typename T>
|
||||
variant(const T& value)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
::new (static_cast<T*>(data)) T(value);
|
||||
type_id = Type_Id_Lookup<T>::type_id;
|
||||
@ -718,7 +718,7 @@ namespace etl
|
||||
template <typename T, typename TP1>
|
||||
T& emplace(const TP1& value1)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(value1);
|
||||
@ -733,7 +733,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2>
|
||||
T& emplace(const TP1& value1, const TP2& value2)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(value1, value2);
|
||||
@ -748,7 +748,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2, typename TP3>
|
||||
T& emplace(const TP1& value1, const TP2& value2, const TP3& value3)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(value1, value2, value3);
|
||||
@ -763,7 +763,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2, typename TP3, typename TP4>
|
||||
T& emplace(const TP1& value1, const TP2& value2, const TP3& value3, const TP4& value4)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(value1, value2, value3, value4);
|
||||
@ -779,7 +779,7 @@ namespace etl
|
||||
template <typename T, typename... Args>
|
||||
T& emplace(Args&&... args)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(std::forward<Args>(args)...);
|
||||
@ -796,7 +796,7 @@ namespace etl
|
||||
template <typename T>
|
||||
variant& operator =(const T& value)
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
|
||||
destruct_current();
|
||||
::new (static_cast<T*>(data)) T(value);
|
||||
@ -933,7 +933,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T& get()
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_ASSERT(is_type<T>(), ETL_ERROR(variant_incorrect_type_exception));
|
||||
|
||||
return static_cast<T&>(data);
|
||||
@ -947,7 +947,7 @@ namespace etl
|
||||
template <typename T>
|
||||
const T& get() const
|
||||
{
|
||||
STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_STATIC_ASSERT(Type_Is_Supported<T>::value, "Unsupported type");
|
||||
ETL_ASSERT(is_type<T>(), ETL_ERROR(variant_incorrect_type_exception));
|
||||
|
||||
return static_cast<const T&>(data);
|
||||
|
||||
@ -140,7 +140,7 @@ namespace etl
|
||||
template <typename T>
|
||||
T* create()
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -167,7 +167,7 @@ namespace etl
|
||||
template <typename T, typename TP1>
|
||||
T* create(const TP1& p1)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -194,7 +194,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2>
|
||||
T* create(const TP1& p1, const TP2& p2)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -221,7 +221,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2, typename TP3>
|
||||
T* create(const TP1& p1, const TP2& p2, const TP3& p3)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -248,7 +248,7 @@ namespace etl
|
||||
template <typename T, typename TP1, typename TP2, typename TP3, typename TP4>
|
||||
T* create(const TP1& p1, const TP2& p2, const TP3& p3, const TP4& p4)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -275,7 +275,7 @@ namespace etl
|
||||
template <typename T, typename... Args>
|
||||
T* create(Args&&... args)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value), "Unsupported type");
|
||||
|
||||
T* p = nullptr;
|
||||
|
||||
@ -303,7 +303,7 @@ namespace etl
|
||||
template <typename T>
|
||||
bool destroy(const T* const p)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value ||
|
||||
ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value ||
|
||||
etl::is_base_of<T, T1>::value ||
|
||||
etl::is_base_of<T, T2>::value ||
|
||||
etl::is_base_of<T, T3>::value ||
|
||||
|
||||
@ -149,7 +149,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -186,7 +186,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -223,7 +223,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -260,7 +260,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -297,7 +297,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -334,7 +334,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
@ -372,7 +372,7 @@ namespace etl
|
||||
{
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.out("STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
cog.out("ETL_STATIC_ASSERT((etl::is_one_of<T, ")
|
||||
for n in range(1, int(NTypes)):
|
||||
cog.out("T%s, " % n)
|
||||
if n % 16 == 0:
|
||||
|
||||
@ -359,7 +359,7 @@ namespace etl
|
||||
template <typename TIterator>
|
||||
void assign(TIterator first, TIterator last)
|
||||
{
|
||||
STATIC_ASSERT((etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename std::iterator_traits<TIterator>::value_type>::type>::value), "Iterator type does not match container type");
|
||||
ETL_STATIC_ASSERT((etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename std::iterator_traits<TIterator>::value_type>::type>::value), "Iterator type does not match container type");
|
||||
|
||||
#if defined(ETL_DEBUG)
|
||||
difference_type d = std::distance(first, last);
|
||||
|
||||
@ -37,10 +37,10 @@ SOFTWARE.
|
||||
/// Definitions of the ETL version
|
||||
///\ingroup utilities
|
||||
|
||||
#define ETL_VERSION "11.11.2"
|
||||
#define ETL_VERSION "11.12.0"
|
||||
#define ETL_VERSION_MAJOR 11
|
||||
#define ETL_VERSION_MINOR 11
|
||||
#define ETL_VERSION_PATCH 2
|
||||
#define ETL_VERSION_MINOR 12
|
||||
#define ETL_VERSION_PATCH 0
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ SOFTWARE.
|
||||
#include "platform.h"
|
||||
#include "static_assert.h"
|
||||
|
||||
STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
|
||||
namespace etl
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@ SOFTWARE.
|
||||
#include "platform.h"
|
||||
#include "static_assert.h"
|
||||
|
||||
STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type");
|
||||
|
||||
namespace etl
|
||||
{
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
===============================================================================
|
||||
11.12.0
|
||||
Renamed STATIC_ASSERT to ETL_STATIC_ASSERT
|
||||
Removed non-conforming std::nullptr
|
||||
|
||||
===============================================================================
|
||||
11.11.1
|
||||
Compatibilty changes for Segger IDE, GCC & STLPort
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user