Changed 'N' to 'MAXN' for compatibility with Texas Instruments compiler.

This commit is contained in:
John Wellbelove 2016-06-18 07:11:17 +01:00
parent 850fd66686
commit 70ea403c7b

View File

@ -416,7 +416,7 @@ namespace etl
template <typename T, std::size_t SIZE>
bool operator <=(const etl::array<T, SIZE>& lhs, const etl::array<T, SIZE>& rhs)
{
return !operator >(lhs, rhs);
return !(lhs > rhs);
}
//*************************************************************************
@ -428,7 +428,7 @@ namespace etl
//*************************************************************************
bool operator >(const etl::array<T, SIZE>& lhs, const etl::array<T, SIZE>& rhs)
{
return operator <(rhs, lhs);
return (rhs < lhs);
}
//*************************************************************************
@ -440,21 +440,21 @@ namespace etl
template <typename T, std::size_t SIZE>
bool operator >=(const etl::array<T, SIZE>& lhs, const etl::array<T, SIZE>& rhs)
{
return !operator <(lhs, rhs);
return !(lhs < rhs);
}
//*************************************************************************
/// Gets a reference to an element in the array.
///\tparam I The index.
///\tparam T The type.
///\tparam N The array size.
///\tparam MAXN The array size.
///\param a The array.
///\return A reference to the element
//*************************************************************************
template <std::size_t I, typename T, std::size_t N>
inline T& get(array<T, N>& a)
template <std::size_t I, typename T, std::size_t MAXN>
inline T& get(array<T, MAXN>& a)
{
STATIC_ASSERT(I < N, "Index out of bounds");
STATIC_ASSERT(I < MAXN, "Index out of bounds");
return a[I];
}
@ -462,14 +462,14 @@ namespace etl
/// Gets a const reference to an element in the array.
///\tparam I The index.
///\tparam T The type.
///\tparam N The array size.
///\tparam MAXN The array size.
///\param a The array.
///\return A const reference to the element
//*************************************************************************
template <std::size_t I, typename T, std::size_t N>
inline const T& get(const array<T, N>& a)
template <std::size_t I, typename T, std::size_t MAXN>
inline const T& get(const array<T, MAXN>& a)
{
STATIC_ASSERT(I < N, "Index out of bounds");
STATIC_ASSERT(I < MAXN, "Index out of bounds");
return a[I];
}
}