const_iterator Class

class QFuture::const_iterator

QFuture::const_iterator クラスは、QFuture 用の STL スタイルの const イテレータを提供します。詳細...

注意:このクラスの関数はすべてリエントラントです。

パブリック型

パブリック関数

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)
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)

詳細説明

QFuture は、STLスタイルのイテレータと Javaスタイルのイテレータの両方を提供する。STLスタイルのイテレータは、より低レベルで使い方が面倒ですが、その反面、若干高速で、すでにSTLを知っている開発者にとっては親しみやすいという利点があります。

デフォルトのQFuture::const_iterator コンストラクタは、初期化されていないイテレータを作成します。繰り返し処理を始める前に、QFuture::constBegin() やQFuture::constEnd() のようなQFuture 関数を使って初期化する必要があります。以下は、未来で利用可能なすべての結果を表示する典型的なループです:

QFuture<QString> future = ...;

QFuture<QString>::const_iterator i;
for (i = future.constBegin(); i != future.constEnd(); ++i)
    cout << qPrintable(*i) << endl;

QFutureIterator およびQFutureも参照して ください。

メンバ型のドキュメント

const_iterator::difference_type

ptrdiff_tの型定義。STL との互換性のために提供される。

const_iterator::iterator_category

std::bidirectional_iterator_tagの型定義。STL との互換性のために用意されています。

const_iterator::pointer

const T * の型定義。STL との互換性のために提供される。

const_iterator::reference

const T & の型定義。STL との互換性のために提供される。

const_iterator::value_type

STL との互換性のために提供される。

メンバ関数ドキュメント

const_iterator::const_iterator()

初期化されていないイテレータを構築する。

operator*() や operator++() のような関数を、初期化されていないイテレータで呼んではいけません。operator=() を使用して値を代入してから使用してください。

QFuture::constBegin() およびQFuture::constEnd()も参照してください

const_iterator::const_iterator(const QFuture<T>::const_iterator &other)

other のコピーを作成する。

const T &const_iterator::operator*() const

現在の結果を返す。

QFuture<T>::const_iterator const_iterator::operator+(int j) const

このイテレータからj 前方の位置の結果へのイテレータを返します。(j が負の場合、イテレータは後方に進む)。

operator-() およびoperator+=()も参照

QFuture<T>::const_iterator &const_iterator::operator++()

prefix++ 演算子 (++it) は、イテレータを未来の次の結果に進め、新しい現在の結果へのイテレータを返します。

QFuture<T>::constEnd() でこの関数を呼び出すと、未定義の結果になります。

operator--()も参照してください

QFuture<T>::const_iterator const_iterator::operator++(int)

これはオーバーロードされた関数である。

postfix++ 演算子(it++)は、イテレータを未来の次の結果に進め、それ以前の現在の結果へのイテレータを返します。

QFuture<T>::const_iterator &const_iterator::operator+=(int j)

j 、イテレータを進めます。(j が負の場合、イテレータは後退する)。

operator-=() およびoperator+()も参照のこと

QFuture<T>::const_iterator const_iterator::operator-(int j) const

このイテレータからj 後方の位置にある結果へのイテレータを返します。(j が負の場合、イテレータは前方に進む)。

operator+() およびoperator-=()も参照

QFuture<T>::const_iterator &const_iterator::operator--()

前置演算子-- (--it) は、直前の結果をカレントにして、新しいカレント結果へのイテレータを返す。

QFuture<T>::constBegin() でこの関数を呼び出すと、未定義の結果になります。

operator++()も参照してください

QFuture<T>::const_iterator const_iterator::operator--(int)

これはオーバーロードされた関数である。

postfix-- 演算子(it--)は、直前の結果をカレントにし、直前のカレント結果へのイテレータを返します。

QFuture<T>::const_iterator &const_iterator::operator-=(int j)

イテレータをj の結果分だけ戻します。(j が負の場合、イテレータは前に進む)。

operator+=() およびoperator-()も参照のこと

const T *const_iterator::operator->() const

現在の結果へのポインタを返す。

QFuture<T>::const_iterator &const_iterator::operator=(const QFuture<T>::const_iterator &other)

このイテレータにother を割り当てます。

関連する非会員

[noexcept] bool operator!=(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)

lhs がイテレータrhs と異なる結果を指している場合はtrue を返し、そうでない場合はfalse を返す。

operator==()も参照

[noexcept] bool operator==(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)

lhs がイテレータrhs と同じ結果を指している場合はtrue を返し、そうでない場合はfalse を返す。

operator!=()も参照

© 2025 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.