QTaggedIterator Class

template <typename Iterator, typename IteratorCategory> class QTaggedIterator

QTaggedIterator はイテレータをラップし、標準的なイテレータの特徴を公開するテンプレート・クラスです。詳細...

ヘッダー #include <QTaggedIterator>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
以来:Qt 6.0

パブリック関数

QTaggedIterator(Iterator &&it)
bool operator!=(const QTaggedIterator<Iterator, IteratorCategory> &other) const
QTaggedIterator<Iterator, IteratorCategory> operator+(qsizetype j) const
QTaggedIterator<Iterator, IteratorCategory> &operator++()
QTaggedIterator<Iterator, IteratorCategory> operator++(int x)
QTaggedIterator<Iterator, IteratorCategory> &operator+=(qsizetype j)
qsizetype operator-(const QTaggedIterator<Iterator, IteratorCategory> &j) const
QTaggedIterator<Iterator, IteratorCategory> operator-(qsizetype j) const
QTaggedIterator<Iterator, IteratorCategory> &operator--()
QTaggedIterator<Iterator, IteratorCategory> operator--(int x)
QTaggedIterator<Iterator, IteratorCategory> &operator-=(qsizetype j)
bool operator==(const QTaggedIterator<Iterator, IteratorCategory> &other) const
QTaggedIterator<Iterator, IteratorCategory> operator+(qsizetype j, const QTaggedIterator<Iterator, IteratorCategory> &k)

詳細な説明

イテレータを標準的なアルゴリズムで使用するには、そのイテレータの特徴を知っている必要があります。QSequentialIterable はさまざまな種類のコンテナで動作するため、イテレータ・クラス自体で特性を宣言することはできません。QTaggedIterator は、イテレータの具体的なインスタンスやQConstIterator の特性を明示的に宣言する方法を提供します。

メンバ関数のドキュメント

QTaggedIterator::QTaggedIterator(Iterator &&it)

イテレータまたはQConstIterator it から QTaggedIterator を構築する。テンプレート引数として渡された IteratorCategory が、it の実行時機能と一致するかどうかをチェックする。一致しない場合、it は拒否される。

bool QTaggedIterator::operator!=(const QTaggedIterator<Iterator, IteratorCategory> &other) const

other がこのイテレータとは異なるアイテムを指している場合はtrue を返し、そうでない場合はfalse を返す。

operator==()も参照

QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator::operator+(qsizetype j) const

このイテレータからj 前方の位置の項目へのイテレータを返します。

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

QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator::operator++()

prefix++ 演算子 (++it) は、コンテナ内の次の項目にイテレータを進め、新しい現在の項目へのイテレータを返します。

QSequentialIterable::end() でこの関数を呼び出すと、未定義の結果になります。

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

QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator::operator++(int x)

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

postfix++ 演算子 (it++) は、コンテナ内の次のアイテムにイテレータを進め、それ以前の現在のアイテムへのイテレータを返します。

QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator::operator+=(qsizetype j)

イテレータをj アイテム分進める。

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

qsizetype QTaggedIterator::operator-(const QTaggedIterator<Iterator, IteratorCategory> &j) const

このイテレータとj との距離を返す。

operator+(),operator-=(),QIterable::canReverseIterate()も参照

QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator::operator-(qsizetype j) const

このイテレータからj 後方の位置のアイテムへのイテレータを返す。

QVariant のコンテナが双方向反復をサポートしていない場合、この関数を呼び出すと未定義の結果になります。

operator+()、operator-=()、QIterable::canReverseIterate()も参照

QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator::operator--()

prefix-- 演算子 (--it) は、直前の項目を現在の項目にし、新しい現在の項目へのイテレータを返します。

QSequentialIterable::begin() でこの関数を呼び出すと、未定義の結果になります。

QVariant のコンテナが双方向反復をサポートしていない場合、この関数を呼び出すと未定義の結果になります。

operator++() およびQIterable::canReverseIterate()も参照

QTaggedIterator<Iterator, IteratorCategory> QTaggedIterator::operator--(int x)

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

postfixの-- 演算子(it--)は、直前の項目をカレントとし、前にカレントだった項目へのイテレータを返す。

QVariant のコンテナが双方向反復をサポートしていない場合、この関数を呼び出すと未定義の結果になります。

QIterable::canReverseIterate()も参照

QTaggedIterator<Iterator, IteratorCategory> &QTaggedIterator::operator-=(qsizetype j)

イテレータをj アイテム分遡らせる。

QVariant のコンテナが双方向反復をサポートしていない場合、この関数を呼び出すと未定義の結果になります。

operator+=()、operator-()、QIterable::canReverseIterate()も参照

bool QTaggedIterator::operator==(const QTaggedIterator<Iterator, IteratorCategory> &other) const

other がこのイテレータと同じアイテムを指している場合はtrue を返し、そうでない場合はfalse を返します。

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

関連する非メンバー

QTaggedIterator<Iterator, IteratorCategory> operator+(qsizetype j, const QTaggedIterator<Iterator, IteratorCategory> &k)

イテレータk からj 前方の位置のアイテムへのイテレータを返す。

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