mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-10 07:09:46 +08:00
Fixed bug in binary > operator.
This commit is contained in:
parent
2808bd2b46
commit
790b29a9f9
17
src/array.h
17
src/array.h
@ -416,11 +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 !std::lexicographical_compare(lhs.cbegin(),
|
||||
lhs.cend(),
|
||||
rhs.cbegin(),
|
||||
rhs.cend(),
|
||||
std::greater<T>());
|
||||
return !operator >(lhs, rhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -432,11 +428,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
bool operator >(const etl::array<T, SIZE>& lhs, const etl::array<T, SIZE>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.cbegin(),
|
||||
lhs.cend(),
|
||||
rhs.cbegin(),
|
||||
rhs.cend(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -448,10 +440,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 !std::lexicographical_compare(lhs.cbegin(),
|
||||
lhs.cend(),
|
||||
rhs.cbegin(),
|
||||
rhs.cend());
|
||||
return !operator <(lhs, rhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1444,11 +1444,7 @@ bool operator <=(const etl::ideque<T>& lhs, const etl::ideque<T>& rhs)
|
||||
template <typename T>
|
||||
bool operator >(const etl::ideque<T>& lhs, const etl::ideque<T>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
||||
@ -1015,11 +1015,7 @@ bool operator <(const etl::iforward_list<T>& lhs, const etl::iforward_list<T>& r
|
||||
template <typename T>
|
||||
bool operator >(const etl::iforward_list<T>& lhs, const etl::iforward_list<T>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1168,11 +1168,7 @@ bool operator <(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
|
||||
template <typename T>
|
||||
bool operator >(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1652,11 +1652,7 @@ bool operator <(const etl::imap<TKey, TMapped, TKeyCompare>& lhs, const etl::ima
|
||||
template <typename TKey, typename TMapped, typename TKeyCompare>
|
||||
bool operator >(const etl::imap<TKey, TMapped, TKeyCompare>& lhs, const etl::imap<TKey, TMapped, TKeyCompare>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<TMapped>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1385,11 +1385,7 @@ bool operator <(const etl::imultimap<TKey, TMapped, TKeyCompare>& lhs, const etl
|
||||
template <typename TKey, typename TMapped, typename TKeyCompare>
|
||||
bool operator >(const etl::imultimap<TKey, TMapped, TKeyCompare>& lhs, const etl::imultimap<TKey, TMapped, TKeyCompare>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<TMapped>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1366,11 +1366,7 @@ bool operator <(const etl::imultiset<T, TCompare>& lhs, const etl::imultiset<T,
|
||||
template <typename T, typename TCompare>
|
||||
bool operator >(const etl::imultiset<T, TCompare>& lhs, const etl::imultiset<T, TCompare>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -1583,11 +1583,7 @@ bool operator <(const etl::iset<T, TCompare>& lhs, const etl::iset<T, TCompare>&
|
||||
template <typename T, typename TCompare>
|
||||
bool operator >(const etl::iset<T, TCompare>& lhs, const etl::iset<T, TCompare>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(),
|
||||
lhs.end(),
|
||||
rhs.begin(),
|
||||
rhs.end(),
|
||||
std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -731,7 +731,7 @@ namespace etl
|
||||
template <typename T>
|
||||
bool operator >(const etl::ivector<T>& lhs, const etl::ivector<T>& rhs)
|
||||
{
|
||||
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), std::greater<T>());
|
||||
return operator <(rhs, lhs);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user