Fixed bug in binary > operator.

This commit is contained in:
John Wellbelove 2016-06-04 21:11:12 +01:00
parent 2808bd2b46
commit 790b29a9f9
9 changed files with 11 additions and 50 deletions

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//***************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//*************************************************************************

View File

@ -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);
}
//***************************************************************************