QKeyValueIterator Class
template <typename Key, typename T, typename Iterator> class QKeyValueIterator連想コンテナのキーと値のペアに対するイテレータ。詳細...
ヘッダ: | #include <QKeyValueIterator> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
パブリック関数
QKeyValueIterator() | |
QKeyValueIterator(Iterator o) | |
Iterator | base() const |
std::pair<Key, T> | operator*() const |
QKeyValueIterator<Key, T, Iterator> & | operator++() |
QKeyValueIterator<Key, T, Iterator> | operator++(int) |
QKeyValueIterator<Key, T, Iterator> & | operator--() |
QKeyValueIterator<Key, T, Iterator> | operator--(int) |
QKeyValueIterator<Key, T, Iterator>::pointer | operator->() const |
関連する非メンバー
bool | operator!=(QKeyValueIterator<Key, T, Iterator> lhs, QKeyValueIterator<Key, T, Iterator> rhs) |
bool | operator==(QKeyValueIterator<Key, T, Iterator> lhs, QKeyValueIterator<Key, T, Iterator> rhs) |
詳細説明
QKeyValueIterator クラスは、QHash やQMap のような連想コンテナからキー/値のペアを返すための STL スタイルのイテレータを提供します。STL の連想コンテナと同じ API をサポートしています。
これにより、QMap,QHash とその友人と STL スタイルのアルゴリズムとの相互運用性が向上します。
警告 暗黙的に共有されたコンテナ上のイテレータは、STLイテレータのようには動作しません。イテレータがコンテナ上でアクティブになっている間は、コンテナのコピーを避けるべきである。詳細は、暗黙的共有イテレータの問題を参照。
メンバ関数のドキュメント
QKeyValueIterator::QKeyValueIterator()
デフォルトの QKeyValueIterator を構築します。
[explicit constexpr noexcept(...)]
QKeyValueIterator::QKeyValueIterator(Iterator o)
o の上に QKeyValueIterator を構築する。
注意: この関数は、std::is_nothrow_move_constructible<Iterator>::value
がtrue
の場合は noexcept となります。
Iterator QKeyValueIterator::base() const
このQKeyValueIterator が基にしているイテレータを返します。
std::pair<Key, T> QKeyValueIterator::operator*() const
現在のエントリーをペアで返す。
QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator++()
prefix++
演算子 (++i
) は、イテレータをコンテナの次の項目に進め、イテレータを返します。
注意: コンテナの end() を超えてイテレータを進めると、未定義の動作になります。
operator--()も参照してください 。
QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator++(int)
これはオーバーロードされた関数です。
postfix++
演算子 (i++
) は、イテレータをコンテナの次の項目に進め、イテレータの前の値を返します。
注意: コンテナの end() を超えてイテレータを進めると、未定義の動作になります。
QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator--()
接頭辞 c{-} 演算子 (--i
) は、コンテナの前の項目までイテレータを戻し、イテレータを返します。
注意: イテレータをコンテナの begin() より前に戻すと、未定義の動作になります。
operator++()も参照してください 。
QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator--(int)
これはオーバーロードされた関数です。
後置 c{-} 演算子 (i--
) は、コンテナ内の前の項目までイテレータを戻し、イテレータの前の値を返します。
注意: イテレータをコンテナの begin() より前まで後退させると、未定義の動作になります。
QKeyValueIterator<Key, T, Iterator>::pointer QKeyValueIterator::operator->() const
現在のエントリーを、ペアへのポインターのようなオブジェクトとして返します。
operator*()も参照 ください。
関連する非会員
[noexcept]
bool operator!=(QKeyValueIterator<Key, T, Iterator> lhs, QKeyValueIterator<Key, T, Iterator> rhs)
rhs がlhs と異なる項目を指している場合はtrue
を返し、そうでない場合はfalse
を返す。
operator==()も参照 。
[noexcept]
bool operator==(QKeyValueIterator<Key, T, Iterator> lhs, QKeyValueIterator<Key, T, Iterator> rhs)
rhs がlhs と同じ項目を指している場合は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.