diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-03-31 00:14:24 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-10-13 18:07:20 +0000 |
commit | 967e4f258cd39991fd2d0ac3753544900d51fbc2 (patch) | |
tree | 6a2ef53300750c0efcf8ce16332522fe2bbed8c3 /src/corelib/tools/qset.qdoc | |
parent | 0df5d079290b4c3b13e58e9397fabdc1dfdba96b (diff) |
QLinkedList/QSet: add {const_,}reverse_iterator, {c,}r{begin,end}()
Now all Qt sequential containers consistently provide reverse iterators.
The associative ones, by way of not returning std::pair from op*, can't
just use std::reverse_iterator. They would miss .key() and .value() methods.
So that has to wait for 5.7.
The reverse versions of the new key_iterators can also just use
std::reverse_iterator, but I'm afraid that after bikeshedding over
keyRBegin() vs. rKeyBegin() vs. reverseKeyBegin() vs. rkbegin()
vs. krbegin() (<-- of course, what else?), it would anyway be too
late for 5.6, so defer, too.
[ChangeLog][QtCore][QLinkedList/QSet] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.
Task-number: QTBUG-25919
Change-Id: I58316fffade469e9a42c61d7aa1455ae3443fd94
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qset.qdoc')
-rw-r--r-- | src/corelib/tools/qset.qdoc | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index d91a589aa1..542def4651 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -384,6 +384,52 @@ \sa constBegin(), end() */ +/*! \fn QSet::reverse_iterator QSet::rbegin() + \since 5.6 + + Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first + item in the set, in reverse order. + + \sa begin(), crbegin(), rend() +*/ + +/*! \fn QSet::const_reverse_iterator QSet::rbegin() const + \since 5.6 + \overload +*/ + +/*! \fn QSet::const_reverse_iterator QSet::crbegin() const + \since 5.6 + + Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first + item in the set, in reverse order. + + \sa begin(), rbegin(), rend() +*/ + +/*! \fn QSet::reverse_iterator QSet::rend() + \since 5.6 + + Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past + the last item in the set, in reverse order. + + \sa end(), crend(), rbegin() +*/ + +/*! \fn QSet::const_reverse_iterator QSet::rend() const + \since 5.6 + \overload +*/ + +/*! \fn QSet::const_reverse_iterator QSet::crend() const + \since 5.6 + + Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one + past the last item in the set, in reverse order. + + \sa end(), rend(), rbegin() +*/ + /*! \typedef QSet::Iterator \since 4.2 @@ -445,6 +491,38 @@ Typedef for T. Provided for STL compatibility. */ +/*! \typedef QSet::reverse_iterator + \since 5.6 + + The QSet::reverse_iterator typedef provides an STL-style non-const + reverse iterator for QSet. + + It is simply a typedef for \c{std::reverse_iterator<QSet::iterator>}. + + \warning Iterators on implicitly shared containers do not work + exactly like STL-iterators. You should avoid copying a container + while iterators are active on that container. For more information, + read \l{Implicit sharing iterator problem}. + + \sa QSet::rbegin(), QSet::rend(), QSet::const_reverse_iterator, QSet::iterator +*/ + +/*! \typedef QSet::const_reverse_iterator + \since 5.6 + + The QSet::const_reverse_iterator typedef provides an STL-style const + reverse iterator for QSet. + + It is simply a typedef for \c{std::reverse_iterator<QSet::const_iterator>}. + + \warning Iterators on implicitly shared containers do not work + exactly like STL-iterators. You should avoid copying a container + while iterators are active on that container. For more information, + read \l{Implicit sharing iterator problem}. + + \sa QSet::rbegin(), QSet::rend(), QSet::reverse_iterator, QSet::const_iterator +*/ + /*! \fn QSet::const_iterator QSet::insert(const T &value) |