QFuture::const_iterator Class
class QFuture::const_iteratorDie Klasse „ QFuture::const_iterator “ stellt einen const-Iterator im STL-Stil für „ QFuture “ bereit. Mehr...
Hinweis: Alle Funktionen dieser Klasse sind reentrant.
Öffentliche Typen
Öffentliche Funktionen
| const_iterator() | |
| const_iterator(const QFuture<T>::const_iterator &other) | |
| const T & | operator*() const |
| QFuture<T>::const_iterator | operator+(int j) const |
| QFuture<T>::const_iterator & | operator++() |
| QFuture<T>::const_iterator | operator++(int) |
| QFuture<T>::const_iterator & | operator+=(int j) |
| QFuture<T>::const_iterator | operator-(int j) const |
| QFuture<T>::const_iterator & | operator--() |
| QFuture<T>::const_iterator | operator--(int) |
| QFuture<T>::const_iterator & | operator-=(int j) |
| const T * | operator->() const |
| QFuture<T>::const_iterator & | operator=(const QFuture<T>::const_iterator &other) |
Verwandte Nicht-Mitglieder
| bool | operator!=(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs) |
| bool | operator==(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs) |
Ausführliche Beschreibung
QFuture bietet sowohl Iteratoren im STL-Stil als auch Iteratoren im Java-Stil. Die Iteratoren im STL-Stil sind eher auf niedrigerer Ebene angesiedelt und umständlicher zu verwenden; andererseits sind sie etwas schneller und bieten Entwicklern, die bereits mit STL vertraut sind, den Vorteil der Vertrautheit.
Der Standardkonstruktor ` QFuture::const_iterator ` erstellt einen nicht initialisierten Iterator. Sie müssen ihn mithilfe einer ` QFuture `-Funktion wie ` QFuture::constBegin()` oder ` QFuture::constEnd()` initialisieren, bevor Sie mit der Iteration beginnen. Hier ist eine typische Schleife, die alle in einem Future verfügbaren Ergebnisse ausgibt:
QFuture<QString> future = someQStringFuture;
QFuture<QString>::const_iterator i;
for (i = future.constBegin(); i != future.constEnd(); ++i)
cout << qPrintable(*i) << endl;Siehe auch „ QFutureIterator “ und „ QFuture “.
Dokumentation zu Mitgliedstypen
const_iterator::difference_type
Typedef für ptrdiff_t. Wird aus Gründen der STL-Kompatibilität bereitgestellt.
const_iterator::iterator_category
Typedef für std::bidirectional_iterator_tag. Wird aus Gründen der STL-Kompatibilität bereitgestellt.
const_iterator::pointer
Typedef für const T *. Wird aus Gründen der STL-Kompatibilität bereitgestellt.
const_iterator::reference
Typedef für `const T &`. Wird aus Gründen der STL-Kompatibilität bereitgestellt.
const_iterator::value_type
Typedef für T. Wird aus Gründen der STL-Kompatibilität bereitgestellt.
Dokumentation zu den Mitgliedsfunktionen
[default] const_iterator::const_iterator()
Erzeugt einen nicht initialisierten Iterator.
Funktionen wie operator*() und operator++() sollten nicht für einen nicht initialisierten Iterator aufgerufen werden. Verwenden Sie operator=(), um ihm vor der Verwendung einen Wert zuzuweisen.
Siehe auch ` QFuture::constBegin()` und ` QFuture::constEnd()`.
const_iterator::const_iterator(const QFuture<T>::const_iterator &other)
Erstellt eine Kopie von „ other “.
const T &const_iterator::operator*() const
Gibt das aktuelle Ergebnis zurück.
QFuture<T>::const_iterator const_iterator::operator+(int j) const
Gibt einen Iterator zurück, der auf die Ergebnisse an den Positionen j vor diesem Iterator verweist. (Ist j negativ, bewegt sich der Iterator rückwärts.)
Siehe auch „ operator-()“ und „ operator+=()“.
QFuture<T>::const_iterator &const_iterator::operator++()
Der Präfixoperator „ ++ “ (++it) verschiebt den Iterator auf das nächste Ergebnis in der Zukunft und gibt einen Iterator auf das neue aktuelle Ergebnis zurück.
Der Aufruf dieser Funktion auf ` QFuture<T>::constEnd()` führt zu undefinierten Ergebnissen.
Siehe auch ` operator--()`.
QFuture<T>::const_iterator const_iterator::operator++(int)
Der Postfix-Operator „ ++ “ (it++) verschiebt den Iterator auf das nächste Ergebnis in der Zukunft und gibt einen Iterator auf das zuvor aktuelle Ergebnis zurück.
Dies ist eine überladene Funktion.
QFuture<T>::const_iterator &const_iterator::operator+=(int j)
Bewegt den Iterator um j Ergebnisse weiter. (Ist j negativ, bewegt sich der Iterator rückwärts.)
Siehe auch ` operator-=()` und ` operator+()`.
QFuture<T>::const_iterator const_iterator::operator-(int j) const
Gibt einen Iterator zurück, der auf die Position verweist, die sich j Stellen rückwärts von diesem Iterator befindet. (Ist j negativ, bewegt sich der Iterator vorwärts.)
Siehe auch operator+() und operator-=().
QFuture<T>::const_iterator &const_iterator::operator--()
Der Präfixoperator „ -- “ (--it) setzt das vorhergehende Ergebnis als aktuelles Ergebnis und gibt einen Iterator auf das neue aktuelle Ergebnis zurück.
Der Aufruf dieser Funktion auf ` QFuture<T>::constBegin()` führt zu undefinierten Ergebnissen.
Siehe auch ` operator++()`.
QFuture<T>::const_iterator const_iterator::operator--(int)
Der Postfix-Operator „ -- “ (it--) macht das vorhergehende Ergebnis zum aktuellen und gibt einen Iterator auf das zuvor aktuelle Ergebnis zurück.
Dies ist eine überladene Funktion.
QFuture<T>::const_iterator &const_iterator::operator-=(int j)
Bewegt den Iterator um j Ergebnisse zurück. (Ist j negativ, bewegt sich der Iterator vorwärts.)
Siehe auch operator+=() und operator-().
const T *const_iterator::operator->() const
Gibt einen Zeiger auf das aktuelle Ergebnis zurück.
QFuture<T>::const_iterator &const_iterator::operator=(const QFuture<T>::const_iterator &other)
Weist diesem Iterator „ other “ zu.
Verwandte Nicht-Mitglieder
[noexcept] bool operator!=(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)
Gibt „ true “ zurück, wenn „ lhs “ auf ein anderes Ergebnis verweist als der Iterator „ rhs “; andernfalls wird „ false “ zurückgegeben.
Siehe auch operator==().
[noexcept] bool operator==(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)
Gibt „ true “ zurück, wenn „ lhs “ auf dasselbe Ergebnis verweist wie der Iterator „ rhs “; andernfalls wird „ false “ zurückgegeben.
Siehe auch operator!=().
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.