Skip to content

Commit 0449e6f

Browse files
committed
ARMC5 <array>: add comparison operators
1 parent 9f258c4 commit 0449e6f

File tree

1 file changed

+37
-1
lines changed
  • platform/cxxsupport/TOOLCHAIN_ARMC5

1 file changed

+37
-1
lines changed

platform/cxxsupport/TOOLCHAIN_ARMC5/array

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,44 @@ struct array {
160160
}
161161
};
162162

163+
template <typename _TypeT, size_t _Size>
164+
bool operator==(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
165+
{
166+
return equal(__x.begin(), __x.end(), __y.begin());
167+
}
168+
169+
template <typename _TypeT, size_t _Size>
170+
bool operator!=(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
171+
{
172+
return !(__x == __y);
173+
}
174+
175+
template <typename _TypeT, size_t _Size>
176+
bool operator<(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
177+
{
178+
return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
179+
}
180+
181+
template <typename _TypeT, size_t _Size>
182+
bool operator>(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
183+
{
184+
return __y < __x;
185+
}
186+
187+
template <typename _TypeT, size_t _Size>
188+
bool operator<=(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
189+
{
190+
return !(__x > __y);
191+
}
192+
193+
template <typename _TypeT, size_t _Size>
194+
bool operator>=(const array<_TypeT, _Size> &__x, const array<_TypeT, _Size> &__y)
195+
{
196+
return !(__x < __y);
197+
}
198+
163199
// [array.special]
164-
template <class _TypeT, size_t _Size>
200+
template <typename _TypeT, size_t _Size>
165201
void swap(array<_TypeT, _Size> &__x, array<_TypeT, _Size> &__y)
166202
{
167203
__x.swap(__y);

0 commit comments

Comments
 (0)