mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Changed 'N' to 'MAXN' for compatibility with Texas Instruments compiler.
This commit is contained in:
parent
850fd66686
commit
70ea403c7b
22
src/array.h
22
src/array.h
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user