QKeyValueIterator Class
template <typename Key, typename T, typename Iterator> class QKeyValueIterator연관 컨테이너의 키/값 쌍에 대한 이터레이터입니다. 더 보기...
Header: | #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
일 때를 제외하고는 작동하지 않습니다.
Iterator QKeyValueIterator::base() const
QKeyValueIterator 의 기반이 되는 기본 이터레이터를 반환합니다.
std::pair<Key, T> QKeyValueIterator::operator*() const
현재 항목을 쌍으로 반환합니다.
QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator++()
접두사 ++
연산자(++i
)는 반복자를 컨테이너의 다음 항목으로 전진시키고 반복자를 반환합니다.
참고: 컨테이너의 끝()을 지나서 반복자를 전진시키는 것은 정의되지 않은 동작을 구성합니다.
operator--()도 참조하세요 .
QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator++(int)
이 함수는 오버로드된 함수입니다.
후위 ++
연산자(i++
)는 반복자를 컨테이너의 다음 항목으로 전진시키고 반복자의 이전 값을 반환합니다.
참고: 컨테이너의 end()를 지나서 반복자를 전진시키는 것은 정의되지 않은 동작을 구성합니다.
QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator--()
접두사 c{-} 연산자(--i
)는 컨테이너의 이전 항목까지 반복자를 백업하고 반복자를 반환합니다.
참고: 반복자를 컨테이너의 시작() 이전으로 백업하는 것은 정의되지 않은 동작을 구성합니다.
operator++()도 참조하세요 .
QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator--(int)
이 함수는 오버로드된 함수입니다.
후위 c{-} 연산자(i--
)는 컨테이너의 이전 항목까지 반복자를 백업하고 반복자의 이전 값을 반환합니다.
참고: 반복자를 컨테이너의 시작() 이전으로 백업하는 것은 정의되지 않은 동작을 구성합니다.
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.