summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-03-27 20:56:44 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-04-02 18:49:20 +0000
commit34c6fbf846b12fa11a863e5c0d3ad5651eb5db48 (patch)
tree0aaf60f48be009caf79567bbc105f3f056626bd2 /src/corelib/tools/qvector.cpp
parent929cc27ffe7b35177e34ac8728bdbeeb5464cd6b (diff)
QVector: add relational operators <,<=,>,>=
std::vector has them, too. [ChangeLog][QtCore][QVector] Added relational operators <, <=, >, >= if the element type supports operator<. Change-Id: I0bcb22dfcc43cb0362f17b4e06154ce18646580a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qvector.cpp')
-rw-r--r--src/corelib/tools/qvector.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index d10f82fbb4..de29fb3cf5 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -290,6 +290,54 @@
\sa operator==()
*/
+/*! \fn bool operator<(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator<=(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>=(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
/*! \fn int QVector::size() const
Returns the number of items in the vector.