QJsonArray::const_iterator Class
class QJsonArray::const_iteratorQJsonArray::const_iterator 클래스는 ` QJsonArray`에 대한 STL 스타일의 const 이터레이터를 제공합니다. 더 보기...
QJsonArray::const_iterator 비교
| 범주 | 비교 가능한 유형 |
|---|---|
| strong | QJsonArray::const_iterator |
| strong | QJsonArray::iterator. |
공개 유형
공개 함수
| const_iterator() | |
| const_iterator(const QJsonArray::iterator &other) | |
| const_iterator(const QJsonArray::const_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 QJsonArray 를 반복 처리할 수 있게 해줍니다. 반복 처리하는 동안 를 수정하려면 대신 를 사용하십시오. 일반적으로, 반복자를 통해 를 변경할 필요가 없는 한, 비const 에 대해서도 를 사용하는 것이 좋습니다. const 반복자는 속도가 약간 더 빠르며 코드의 가독성을 높여줍니다. QJsonArray QJsonArray::iterator QJsonArray QJsonArray QJsonArray::const_iterator
QJsonArray::const_iterator 의 기본 생성자는 초기화되지 않은 이터레이터를 생성합니다. 반복 처리를 시작하기 전에 QJsonArray::constBegin(), QJsonArray::constEnd(), 또는 QJsonArray::insert()과 같은 QJsonArray 함수를 사용하여 이터레이터를 초기화해야 합니다.
대부분의 QJsonArray 함수는 이터레이터 대신 정수 인덱스를 받아들입니다. 이러한 이유로, 이터레이터는 QJsonArray 와 함께 사용할 때 거의 유용하지 않습니다. STL 스타일의 이터레이터가 실제로 유용한 경우는 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 의 복사본을 생성합니다.
[constexpr noexcept default] const_iterator::const_iterator(const QJsonArray::const_iterator &other)
const_iterator 의 인스턴스를 복사 생성합니다.
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 `를 반환합니다.
© 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.