From 790b29a9f9d836a795b0543b88e57b9c576506a3 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 4 Jun 2016 21:11:12 +0100 Subject: [PATCH] Fixed bug in binary > operator. --- src/array.h | 17 +++-------------- src/ideque.h | 6 +----- src/iforward_list.h | 6 +----- src/ilist.h | 6 +----- src/imap.h | 6 +----- src/imultimap.h | 6 +----- src/imultiset.h | 6 +----- src/iset.h | 6 +----- src/ivector.h | 2 +- 9 files changed, 11 insertions(+), 50 deletions(-) diff --git a/src/array.h b/src/array.h index ac0a80b6..1574fb93 100644 --- a/src/array.h +++ b/src/array.h @@ -416,11 +416,7 @@ namespace etl template bool operator <=(const etl::array& lhs, const etl::array& rhs) { - return !std::lexicographical_compare(lhs.cbegin(), - lhs.cend(), - rhs.cbegin(), - rhs.cend(), - std::greater()); + return !operator >(lhs, rhs); } //************************************************************************* @@ -432,11 +428,7 @@ namespace etl //************************************************************************* bool operator >(const etl::array& lhs, const etl::array& rhs) { - return std::lexicographical_compare(lhs.cbegin(), - lhs.cend(), - rhs.cbegin(), - rhs.cend(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* @@ -448,10 +440,7 @@ namespace etl template bool operator >=(const etl::array& lhs, const etl::array& rhs) { - return !std::lexicographical_compare(lhs.cbegin(), - lhs.cend(), - rhs.cbegin(), - rhs.cend()); + return !operator <(lhs, rhs); } //************************************************************************* diff --git a/src/ideque.h b/src/ideque.h index a700904d..62911c42 100644 --- a/src/ideque.h +++ b/src/ideque.h @@ -1444,11 +1444,7 @@ bool operator <=(const etl::ideque& lhs, const etl::ideque& rhs) template bool operator >(const etl::ideque& lhs, const etl::ideque& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //*************************************************************************** diff --git a/src/iforward_list.h b/src/iforward_list.h index 98ecdc20..7fa310c9 100644 --- a/src/iforward_list.h +++ b/src/iforward_list.h @@ -1015,11 +1015,7 @@ bool operator <(const etl::iforward_list& lhs, const etl::iforward_list& r template bool operator >(const etl::iforward_list& lhs, const etl::iforward_list& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/ilist.h b/src/ilist.h index b969f71d..7a21e381 100644 --- a/src/ilist.h +++ b/src/ilist.h @@ -1168,11 +1168,7 @@ bool operator <(const etl::ilist& lhs, const etl::ilist& rhs) template bool operator >(const etl::ilist& lhs, const etl::ilist& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/imap.h b/src/imap.h index cd6dd2e9..0d0fad68 100644 --- a/src/imap.h +++ b/src/imap.h @@ -1652,11 +1652,7 @@ bool operator <(const etl::imap& lhs, const etl::ima template bool operator >(const etl::imap& lhs, const etl::imap& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/imultimap.h b/src/imultimap.h index 628e1239..a1505827 100644 --- a/src/imultimap.h +++ b/src/imultimap.h @@ -1385,11 +1385,7 @@ bool operator <(const etl::imultimap& lhs, const etl template bool operator >(const etl::imultimap& lhs, const etl::imultimap& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/imultiset.h b/src/imultiset.h index f25d4808..5a05a897 100644 --- a/src/imultiset.h +++ b/src/imultiset.h @@ -1366,11 +1366,7 @@ bool operator <(const etl::imultiset& lhs, const etl::imultiset bool operator >(const etl::imultiset& lhs, const etl::imultiset& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/iset.h b/src/iset.h index 17b989d6..21f65924 100644 --- a/src/iset.h +++ b/src/iset.h @@ -1583,11 +1583,7 @@ bool operator <(const etl::iset& lhs, const etl::iset& template bool operator >(const etl::iset& lhs, const etl::iset& rhs) { - return std::lexicographical_compare(lhs.begin(), - lhs.end(), - rhs.begin(), - rhs.end(), - std::greater()); + return operator <(rhs, lhs); } //************************************************************************* diff --git a/src/ivector.h b/src/ivector.h index 39659469..541ed3f8 100644 --- a/src/ivector.h +++ b/src/ivector.h @@ -731,7 +731,7 @@ namespace etl template bool operator >(const etl::ivector& lhs, const etl::ivector& rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), std::greater()); + return operator <(rhs, lhs); } //***************************************************************************