summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qiterable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qiterable.cpp')
-rw-r--r--src/corelib/kernel/qiterable.cpp269
1 files changed, 128 insertions, 141 deletions
diff --git a/src/corelib/kernel/qiterable.cpp b/src/corelib/kernel/qiterable.cpp
index f397749e51..a8c93fbc1c 100644
--- a/src/corelib/kernel/qiterable.cpp
+++ b/src/corelib/kernel/qiterable.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/qiterable.h>
@@ -43,62 +7,62 @@ QT_BEGIN_NAMESPACE
/*!
\class QBaseIterator
-
+ \inmodule QtCore
QBaseIterator forms the common base class for all iterators operating on
subclasses of QIterable.
*/
/*!
- \fn QBaseIterator::QBaseIterator(const QIterable *iterable, void *iterator)
+ \fn template<class Container> QBaseIterator<Container>::QBaseIterator(const QIterable<Container> *iterable, void *iterator)
\internal
Creates a const QBaseIterator from an \a iterable and an \a iterator.
*/
/*!
- \fn QBaseIterator::QBaseIterator(QIterable *iterable, void *iterator)
+ \fn template<class Container> QBaseIterator<Container>::QBaseIterator(QIterable<Container> *iterable, void *iterator)
\internal
Creates a non-const QBaseIterator from an \a iterable and an \a iterator.
*/
/*!
- \fn QBaseIterator::QBaseIterator(QBaseIterator &&other)
+ \fn template<class Container> QBaseIterator<Container>::QBaseIterator(QBaseIterator<Container> &&other)
\internal
Move-constructs a QBaseIterator from \a other, preserving its const-ness.
*/
/*!
- \fn QBaseIterator::QBaseIterator(const QBaseIterator &other)
+ \fn template<class Container> QBaseIterator<Container>::QBaseIterator(const QBaseIterator<Container> &other)
\internal
Copy-constructs a QBaseIterator from \a other, preserving its const-ness.
*/
/*!
- \fn QBaseIterator::~QBaseIterator()
+ \fn template<class Container> QBaseIterator<Container>::~QBaseIterator()
\internal
Destroys a QBaseIterator.
*/
/*!
- \fn QBaseIterator &QBaseIterator::operator=(const QBaseIterator &other)
+ \fn template<class Container> QBaseIterator<Container> &QBaseIterator<Container>::operator=(const QBaseIterator<Container> &other)
\internal
Copy-assigns a QBaseIterator from \a other, preserving its const-ness.
*/
/*!
- \fn void QBaseIterator::initIterator(const void *copy)
+ \fn template<class Container> void QBaseIterator<Container>::initIterator(const void *copy)
\internal
Initializes the internal native iterator by duplicating \a copy, if given.
*/
/*!
- \fn void QBaseIterator::clearIterator()
+ \fn template<class Container> void QBaseIterator<Container>::clearIterator()
\internal
Destroys the internal native iterator.
@@ -106,14 +70,14 @@ QT_BEGIN_NAMESPACE
/*!
- \fn QMetaContainer QBaseIterator::metaContainer() const
+ \fn QMetaContainer QBaseIterator<Container>::metaContainer() const
\internal
Returns the meta sequence.
*/
/*!
- \fn QIterable *QBaseIterator::mutableIterable() const
+ \fn template<class Container> QIterable *QBaseIterator<Container>::mutableIterable() const
\internal
Returns a non-const pointer to the iterable, if the original iterable was
@@ -121,36 +85,36 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn const QIterable *QBaseIterator::constIterable() const
+ \fn template<class Container> const QIterable *QBaseIterator<Container>::constIterable() const
\internal
Returns a const pointer to the iterable.
*/
/*!
- \fn void *QBaseIterator::mutableIterator()
+ \fn template<class Container> void *QBaseIterator<Container>::mutableIterator()
Returns a non-const pointer to the internal native iterator.
*/
/*!
- \fn const void *QBaseIterator::constIterator() const
+ \fn template<class Container> const void *QBaseIterator<Container>::constIterator() const
Returns a const pointer to the internal native iterator.
*/
/*!
- \fn QBaseIterator &QBaseIterator::operator=(QBaseIterator &&other)
+ \fn template<class Container> QBaseIterator &QBaseIterator<Container>::operator=(QBaseIterator<Container> &&other)
\internal
Move-assigns a QBaseIterator from \a other, preserving its const-ness.
*/
/*!
- \class Qiterator
+ \class QIterator
\since 6.0
\inmodule QtCore
- \brief The QIterator allows iteration over a container in a QVariant.
+ \brief The QIterator is a template class that allows iteration over a container in a QVariant.
A QIterator can only be created by a QIterable instance, and can be used
in a way similar to other stl-style iterators. Generally, QIterator should
@@ -161,13 +125,13 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QIterator::QIterator(QIterable *iterable, void *iterator)
+ \fn template<class Container> QIterator<Container>::QIterator(QIterable<Container> *iterable, void *iterator)
Creates an iterator from an \a iterable and a pointer to a native \a iterator.
*/
/*!
- \fn bool QIterator::operator==(const QIterator &other) const
+ \fn template<class Container> bool QIterator<Container>::operator==(const QIterator<Container> &other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -176,7 +140,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QIterator::operator!=(const QIterator &other) const
+ \fn template<class Container> bool QIterator<Container>::operator!=(const QIterator<Container> &other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -185,9 +149,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QIterator &QIterator::operator++()
+ \fn template<class Container> QIterator<Container> &QIterator<Container>::operator++()
- The prefix ++ operator (\c{++it}) advances the iterator to the
+ The prefix \c{++} operator (\c{++it}) advances the iterator to the
next item in the container and returns an iterator to the new current
item.
@@ -197,19 +161,19 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QIterator QIterator::operator++(int)
+ \fn template<class Container> QIterator<Container> QIterator<Container>::operator++(int)
\overload
- The postfix ++ operator (\c{it++}) advances the iterator to the
+ The postfix \c{++} operator (\c{it++}) advances the iterator to the
next item in the container and returns an iterator to the previously
current item.
*/
/*!
- \fn QIterator &QIterator::operator--()
+ \fn template<class Container> QIterator<Container> &QIterator<Container>::operator--()
- The prefix -- operator (\c{--it}) makes the preceding item
+ The prefix \c{--} operator (\c{--it}) makes the preceding item
current and returns an iterator to the new current item.
Calling this function on QSequentialIterable::begin() leads to undefined results.
@@ -217,25 +181,25 @@ QT_BEGIN_NAMESPACE
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator++(), canReverseIterate()
+ \sa operator++(), QIterable::canReverseIterate()
*/
/*!
- \fn QIterator QIterator::operator--(int)
+ \fn template<class Container> QIterator<Container> QIterator<Container>::operator--(int)
\overload
- The postfix -- operator (\c{it--}) makes the preceding item
+ The postfix \c{--} operator (\c{it--}) makes the preceding item
current and returns an iterator to the previously current item.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa canReverseIterate()
+ \sa QIterable::canReverseIterate()
*/
/*!
- \fn QIterator &QIterator::operator+=(qsizetype j)
+ \fn template<class Container> QIterator<Container> &QIterator<Container>::operator+=(qsizetype j)
Advances the iterator by \a j items.
@@ -243,18 +207,18 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QIterator &QIterator::operator-=(qsizetype j)
+ \fn template<class Container> QIterator<Container> &QIterator<Container>::operator-=(qsizetype j)
Makes the iterator go back by \a j items.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+=(), operator-(), canReverseIterate()
+ \sa operator+=(), operator-(), QIterable::canReverseIterate()
*/
/*!
- \fn QIterator QIterator::operator+(qsizetype j) const
+ \fn template<class Container> QIterator<Container> QIterator<Container>::operator+(qsizetype j) const
Returns an iterator to the item at \a j positions forward from
this iterator.
@@ -263,7 +227,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QIterator QIterator::operator-(qsizetype j) const
+ \fn template<class Container> QIterator<Container> QIterator<Container>::operator-(qsizetype j) const
Returns an iterator to the item at \a j positions backward from
this iterator.
@@ -271,25 +235,40 @@ QT_BEGIN_NAMESPACE
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+(), operator-=(), canReverseIterate()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
/*!
- \fn qsizetype QIterator::operator-(const QIterator &j) const
+ \fn template<class Container> qsizetype QIterator<Container>::operator-(const QIterator<Container> &j) const
+ \overload
Returns the distance between the two iterators.
- \sa operator+(), operator-=(), canReverseIterator()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
/*!
- QConstIterator::QConstIterator(const QIterable *iterable, void *iterator)
+ \fn template <class Container> QIterator<Container> QIterator<Container>::operator+(qsizetype j, const QIterator<Container> &k)
+
+ Returns an iterator to the item at \a j positions forward from iterator \a k.
+*/
+
+/*!
+ \struct QConstIterator
+ \since 6.0
+ \inmodule QtCore
+ \brief The QConstIterator allows iteration over a container in a QVariant.
+ \sa QIterator, QIterable
+*/
+
+/*!
+ \fn template <class Container> QConstIterator<Container>::QConstIterator(const QIterable<Container> *iterable, void *iterator)
Creates a QConstIterator to wrap \a iterator, operating on \a iterable.
*/
/*!
- bool QConstIterator::operator==(const QConstIterator &other) const
+ \fn template<class Container> bool QConstIterator<Container>::operator==(const QConstIterator<Container> &other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -298,7 +277,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- bool QConstIterator::operator!=(const QConstIterator &other) const
+ \fn template<class Container> bool QConstIterator<Container>::operator!=(const QConstIterator<Container> &other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -307,57 +286,57 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QConstIterator &QConstIterator::operator++()
+ \fn template<class Container> QConstIterator<Container> &QConstIterator<Container>::operator++()
- The prefix ++ operator (\c{++it}) advances the iterator to the
+ The prefix \c{++} operator (\c{++it}) advances the iterator to the
next item in the container and returns an iterator to the new current
item.
- Calling this function on QIterable::end() leads to undefined results.
+ Calling this function on QIterable<Container>::end() leads to undefined results.
\sa operator--()
*/
/*!
- \fn QConstIterator QConstIterator::operator++(int)
+ \fn template<class Container> QConstIterator<Container> QConstIterator<Container>::operator++(int)
\overload
- The postfix ++ operator (\c{it++}) advances the iterator to the
+ The postfix \c{++} operator (\c{it++}) advances the iterator to the
next item in the container and returns an iterator to the previously
current item.
*/
/*!
- \fn QConstIterator &QConstIterator::operator--()
+ \fn template<class Container> QConstIterator<Container> &QConstIterator<Container>::operator--()
- The prefix -- operator (\c{--it}) makes the preceding item
+ The prefix \c{--} operator (\c{--it}) makes the preceding item
current and returns an iterator to the new current item.
- Calling this function on QIterable::begin() leads to undefined results.
+ Calling this function on QIterable<Container>::begin() leads to undefined results.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator++(), canReverseIterate()
+ \sa operator++(), QIterable::canReverseIterate()
*/
/*!
- \fn QConstIterator QConstIterator::operator--(int)
+ \fn template<class Container> QConstIterator<Container> QConstIterator<Container>::operator--(int)
\overload
- The postfix -- operator (\c{it--}) makes the preceding item
+ The postfix \c{--} operator (\c{it--}) makes the preceding item
current and returns an iterator to the previously current item.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa canReverseIterate()
+ \sa QIterable::canReverseIterate()
*/
/*!
- \fn QConstIterator &QConstIterator::operator+=(qsizetype j)
+ \fn template<class Container> QConstIterator<Container> &QConstIterator<Container>::operator+=(qsizetype j)
Advances the iterator by \a j items.
@@ -365,18 +344,18 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QConstIterator &QConstIterator::operator-=(qsizetype j)
+ \fn template<class Container> QConstIterator<Container> &QConstIterator<Container>::operator-=(qsizetype j)
Makes the iterator go back by \a j items.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+=(), operator-(), canReverseIterate()
+ \sa operator+=(), operator-(), QIterable::canReverseIterate()
*/
/*!
- \fn QConstIterator QConstIterator::operator+(qsizetype j) const
+ \fn template<class Container> QConstIterator<Container> QConstIterator<Container>::operator+(qsizetype j) const
Returns an iterator to the item at \a j positions forward from
this iterator.
@@ -385,7 +364,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QConstIterator QConstIterator::operator-(qsizetype j) const
+ \fn template<class Container> QConstIterator<Container> QConstIterator<Container>::operator-(qsizetype j) const
Returns an iterator to the item at \a j positions backward from
this iterator.
@@ -393,26 +372,28 @@ QT_BEGIN_NAMESPACE
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+(), operator-=(), canReverseIterate()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
/*!
- \fn qsizetype QConstIterator::operator-(const QConstIterator &j) const
+ \fn template <class Container> qsizetype QConstIterator<Container>::operator-(const QConstIterator<Container> &j) const
+
+ \overload
Returns the distance between the two iterators.
- \sa operator+(), operator-=(), canReverseIterator()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
/*!
\class QIterable
+ \inmodule QtCore
\since 6.0
-
- QIterable is the base class for QSequentialIterable and QAssociativeIterable.
+ \brief QIterable is a template class that is the base class for QSequentialIterable and QAssociativeIterable.
*/
/*!
- \fn bool QIterable::canInputIterate() const
+ \fn template <class Container> bool QIterable<Container>::canInputIterate() const
Returns whether the container has an input iterator. This corresponds to
the std::input_iterator_tag iterator trait of the iterator and
@@ -420,7 +401,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QIterable::canForwardIterate() const
+ \fn template<class Container> bool QIterable<Container>::canForwardIterate() const
Returns whether it is possible to iterate over the container in forward
direction. This corresponds to the std::forward_iterator_tag iterator trait
@@ -428,7 +409,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QIterable::canReverseIterate() const
+ \fn template<class Container> bool QIterable<Container>::canReverseIterate() const
Returns whether it is possible to iterate over the container in reverse. This
corresponds to the std::bidirectional_iterator_tag iterator trait of the
@@ -436,7 +417,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QIterable::canRandomAccessIterate() const
+ \fn template<class Container> bool QIterable<Container>::canRandomAccessIterate() const
Returns whether it is possible to efficiently skip over multiple values
using and iterator. This corresponds to the std::random_access_iterator_tag
@@ -444,43 +425,43 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QConstIterator QIterable::constBegin() const
+ \fn template<class Container> QConstIterator<Container> QIterable<Container>::constBegin() const
Returns a QConstIterator for the beginning of the container. This
can be used in stl-style iteration.
- \sa end()
+ \sa constEnd(), mutableBegin()
*/
/*!
- \fn QConstIterator QIterable::constEnd() const
+ \fn template<class Container> QConstIterator<Container> QIterable<Container>::constEnd() const
Returns a Qterable::QConstIterator for the end of the container. This
can be used in stl-style iteration.
- \sa begin()
+ \sa constBegin(), mutableEnd()
*/
/*!
- \fn QIterator QIterable::mutableBegin()
+ \fn template<class Container> QIterator<Container> QIterable<Container>::mutableBegin()
Returns a QIterator for the beginning of the container. This
can be used in stl-style iteration.
- \sa end()
+ \sa mutableEnd(), constBegin()
*/
/*!
- \fn QIterator QIterable::mutableEnd()
+ \fn template<class Container> QIterator<Container> QIterable<Container>::mutableEnd()
Returns a QSequentialIterable::iterator for the end of the container. This
can be used in stl-style iteration.
- \sa begin()
+ \sa mutableBegin(), constEnd()
*/
/*!
- \fn qsizetype QIterable::size() const
+ \fn template<class Container> qsizetype QIterable<Container>::size() const
Returns the number of values in the container.
*/
@@ -489,25 +470,25 @@ QT_BEGIN_NAMESPACE
\class QTaggedIterator
\since 6.0
\inmodule QtCore
- \brief Wraps an iterator and exposes standard iterator traits.
+ \brief QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits.
- In order to use an iterator any of the standard algorithms, it iterator
+ In order to use an iterator any of the standard algorithms, its iterator
traits need to be known. As QSequentialIterable can work with many different
kinds of containers, we cannot declare the traits in the iterator classes
- themselves. StdIterator gives you a way to explicitly declare a trait for
+ themselves. A QTaggedIterator gives you a way to explicitly declare a trait for
a concrete instance of an iterator or QConstIterator.
*/
/*!
- \fn QTaggedIterator::StdIterator(Iterator &&it)
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::QTaggedIterator(Iterator &&it)
- Constructs a StdIterator from an iterator or QConstIterator \a it. Checks
+ Constructs a QTaggedIterator from an iterator or QConstIterator \a it. Checks
whether the IteratorCategory passed as template argument matches the run
- time capabilities of \a it and refuses \a it if not.
+ time capabilities of \a it; if there's no match, \a it is refused.
*/
/*!
- \fn bool QTaggedIterator::operator==(const StdIterator &other) const
+ \fn template<class Iterator, typename IteratorCategory> bool QTaggedIterator<Iterator, IteratorCategory>::operator==(const QTaggedIterator<Iterator, IteratorCategory> &other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -516,7 +497,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QTaggedIterator::operator!=(const StdIterator &other) const
+ \fn template<class Iterator, typename IteratorCategory> bool QTaggedIterator<Iterator, IteratorCategory>::operator!=(const QTaggedIterator<Iterator, IteratorCategory> &other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -525,9 +506,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QTaggedIterator &QTaggedIterator::operator++()
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator<Iterator, IteratorCategory>::operator++()
- The prefix ++ operator (\c{++it}) advances the iterator to the
+ The prefix \c{++} operator (\c{++it}) advances the iterator to the
next item in the container and returns an iterator to the new current
item.
@@ -537,19 +518,19 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QTaggedIterator QTaggedIterator::operator++(int)
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::operator++(int)
\overload
- The postfix ++ operator (\c{it++}) advances the iterator to the
+ The postfix \c{++} operator (\c{it++}) advances the iterator to the
next item in the container and returns an iterator to the previously
current item.
*/
/*!
- \fn QTaggedIterator &QTaggedIterator::operator--()
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator<Iterator, IteratorCategory>::operator--()
- The prefix -- operator (\c{--it}) makes the preceding item
+ The prefix \c{--} operator (\c{--it}) makes the preceding item
current and returns an iterator to the new current item.
Calling this function on QSequentialIterable::begin() leads to undefined results.
@@ -557,25 +538,25 @@ QT_BEGIN_NAMESPACE
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator++(), canReverseIterate()
+ \sa operator++(), QIterable::canReverseIterate()
*/
/*!
- \fn QTaggedIterator QTaggedIterator::operator--(int)
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::operator--(int)
\overload
- The postfix -- operator (\c{it--}) makes the preceding item
+ The postfix \c{--} operator (\c{it--}) makes the preceding item
current and returns an iterator to the previously current item.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa canReverseIterate()
+ \sa QIterable::canReverseIterate()
*/
/*!
- \fn QTaggedIterator &QTaggedIterator::operator+=(qsizetype j)
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator<Iterator, IteratorCategory>::operator+=(qsizetype j)
Advances the iterator by \a j items.
@@ -583,18 +564,18 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QTaggedIterator &QTaggedIterator::operator-=(qsizetype j)
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator<Iterator, IteratorCategory>::operator-=(qsizetype j)
Makes the iterator go back by \a j items.
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+=(), operator-(), canReverseIterate()
+ \sa operator+=(), operator-(), QIterable::canReverseIterate()
*/
/*!
- \fn QTaggedIterator QTaggedIterator::operator+(qsizetype j) const
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::operator+(qsizetype j) const
Returns an iterator to the item at \a j positions forward from
this iterator.
@@ -603,7 +584,13 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QTaggedIterator QTaggedIterator::operator-(qsizetype j) const
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::operator+(qsizetype j, const QTaggedIterator &k)
+
+ Returns an iterator to the item at \a j positions forward from iterator \a k.
+*/
+
+/*!
+ \fn template<class Iterator, typename IteratorCategory> QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator<Iterator, IteratorCategory>::operator-(qsizetype j) const
Returns an iterator to the item at \a j positions backward from
this iterator.
@@ -611,15 +598,15 @@ QT_BEGIN_NAMESPACE
If the container in the QVariant does not support bi-directional iteration, calling this function
leads to undefined results.
- \sa operator+(), operator-=(), canReverseIterate()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
/*!
- \fn qsizetype QTaggedIterator::operator-(const QTaggedIterator &j) const
+ \fn template <class Iterator, typename IteratorCategory> qsizetype QTaggedIterator<Iterator, IteratorCategory>::operator-(const QTaggedIterator<Iterator, IteratorCategory> &j) const
- Returns the distance between the two iterators.
+ Returns the distance between this iterator and \a j.
- \sa operator+(), operator-=(), canReverseIterator()
+ \sa operator+(), operator-=(), QIterable::canReverseIterate()
*/
QT_END_NAMESPACE