const_iterator Class
class QJsonArray::const_iteratorQJsonArray::const_iterator クラスは、QJsonArray 用の STL スタイルの const イテレータを提供します。詳細...
このクラスは強く比較可能です。
このクラスはQJsonArray::iterator と強く比較可能です。
パブリック型
パブリック関数
const_iterator() | |
const_iterator(const QJsonArray::iterator &other) | |
const QJsonValueConstRef | operator*() const |
QJsonArray::const_iterator | operator+(qsizetype j) const |
QJsonArray::const_iterator & | operator++() |
QJsonArray::const_iterator | operator++(int) |
QJsonArray::const_iterator & | operator+=(qsizetype j) |
qsizetype | operator-(QJsonArray::const_iterator other) const |
QJsonArray::const_iterator | operator-(qsizetype j) const |
QJsonArray::const_iterator & | operator--() |
QJsonArray::const_iterator | operator--(int) |
QJsonArray::const_iterator & | operator-=(qsizetype j) |
const QJsonValueConstRef * | operator->() const |
QJsonValueConstRef | operator[](qsizetype j) const |
関連する非メンバー
bool | operator!=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
bool | operator<(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
bool | operator<=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
bool | operator==(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
bool | operator>(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
bool | operator>=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs) |
詳細説明
QJsonArray::const_iterator を使うと、 を繰り返し処理できます。 を繰り返し処理しながら変更したい場合は、代わりに を使ってください。イテレータを通して を変更する必要がない限り、const 以外のイテレータでも を使用するのが一般的です。constイテレータの方が若干高速で、コードの可読性も向上します。QJsonArray QJsonArray QJsonArray::iterator QJsonArray QJsonArray QJsonArray::const_iterator
デフォルトのQJsonArray::const_iterator コンストラクタは、初期化されていないイテレータを作成します。QJsonArray::constBegin ()、QJsonArray::constEnd ()、QJsonArray::insert ()のようなQJsonArray 関数を使用して初期化しなければなりません。
ほとんどのQJsonArray 関数は、イテレータではなく整数インデックスを受け付けます。そのため、QJsonArray に関しては、イテレータはほとんど役に立ちません。STLスタイルのイテレータが意味を持つ場所の1つは、generic algorithms への引数です。
同じ配列に対して複数の反復子を使用することができます。ただし、QJsonArray に対して const でない関数を呼び出すと、既存のイテレータがすべて未定義になることに注意してください。
QJsonArray::iteratorも参照してください 。
メンバ型ドキュメント
const_iterator::iterator_category
このイテレータがランダムアクセスイテレータであることを示すstd::random_access_iterator_tagのシノニム。
メンバ関数ドキュメント
const_iterator::const_iterator()
初期化されていないイテレータを構築します。
operator*() や operator++() のような関数を、初期化されていないイテレータに対して呼び出してはいけません。operator=() を使用して値を代入してから使用してください。
QJsonArray::constBegin() およびQJsonArray::constEnd()も参照してください 。
const_iterator::const_iterator(const QJsonArray::iterator &other)
other のコピーを作成する。
const QJsonValueConstRef const_iterator::operator*() const
現在の項目を返します。
QJsonArray::const_iterator const_iterator::operator+(qsizetype j) const
このイテレータからj 前方の位置のアイテムへのイテレータを返します。j が負の場合、イテレータは後方に進みます。
operator-() およびoperator+=()も参照 。
QJsonArray::const_iterator &const_iterator::operator++()
++it
前置演算子++
は、イテレータを配列の次の項目に進め、新しい現在の項目へのイテレータを返す。
この関数をQJsonArray::end() で呼び出すと、未定義の結果になります。
operator--()も参照 。
QJsonArray::const_iterator const_iterator::operator++(int)
これはオーバーロードされた関数である。
ポストフィックス++
演算子it++
は、イテレータを配列の次の項目に進め、それ以前の現在の項目へのイテレータを返します。
QJsonArray::const_iterator &const_iterator::operator+=(qsizetype j)
イテレータをj アイテム分進めます。j が負の場合、イテレータは後退する。
operator-=() およびoperator+()も参照のこと 。
qsizetype const_iterator::operator-(QJsonArray::const_iterator other) const
other が指すアイテムとこのイテレータが指すアイテムの間のアイテム数を返します。
QJsonArray::const_iterator const_iterator::operator-(qsizetype j) const
このイテレータからj 後方の位置のアイテムへのイテレータを返します。j が負の場合、イテレータは前方に進みます。
operator+() およびoperator-=()も参照 。
QJsonArray::const_iterator &const_iterator::operator--()
接頭辞--
演算子--it
は、直前の項目をカレントとし、新しいカレント項目へのイテレータを返す。
この関数をQJsonArray::begin() で呼び出すと、未定義の結果になります。
operator++()も参照 。
QJsonArray::const_iterator const_iterator::operator--(int)
これはオーバーロードされた関数である。
ポストフィックス--
演算子、it--
は、直前の項目をカレントにし、直前の項目へのイテレータを返します。
QJsonArray::const_iterator &const_iterator::operator-=(qsizetype j)
イテレータをj アイテム分戻します。j が負の場合、イテレータは前に進みます。
operator+=() およびoperator-()も参照 。
const QJsonValueConstRef *const_iterator::operator->() const
現在の項目へのポインタを返す。
QJsonValueConstRef const_iterator::operator[](qsizetype j) const
このイテレータが指すアイテム(位置*this + j
のアイテム)からオフセットj にあるアイテムを返します。
この関数は、QJsonArray イテレータを C++ ポインタのように動作させるために用意されています。
operator+()も参照してください 。
関連する非会員
[noexcept]
bool operator!=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs がイテレータrhs と異なるアイテムを指している場合はtrue
を返し、そうでない場合はfalse
を返す。
operator==()も参照 。
[noexcept]
bool operator<(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs イテレータが指すアイテムが、rhs イテレータが指すアイテムより小さい場合、true
を返す。
[noexcept]
bool operator<=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs イテレータが指すアイテムが、rhs イテレータが指すアイテム以下である場合、true
を返す。
[noexcept]
bool operator==(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs がイテレータrhs と同じアイテムを指している場合はtrue
を返し、そうでない場合はfalse
を返す。
operator!=()も参照 。
[noexcept]
bool operator>(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs イテレータが指すアイテムが、rhs イテレータが指すアイテムより大きい場合、true
を返す。
[noexcept]
bool operator>=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
lhs イテレータが指すアイテムが、rhs イテレータが指すアイテム以上であれば、true
を返す。
© 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.