const_iterator Class

class QDirListing::const_iterator

이 클래스는 Qt 6.8에 도입되었습니다.

공용 형

공용 함수

QDirListing::const_iterator::reference operator*() const
QDirListing::const_iterator &operator++()
void operator++(int)
QDirListing::const_iterator::pointer operator->() const

자세한 설명

QDirListing::cbegin()에서 반환하는 이터레이터 유형입니다.

  • 정방향 전용, 단일 패스 이터레이터입니다(디렉터리 항목을 역순으로 이터레이트할 수 없음).
  • 복사할 수 없으며 std::move()d만 복사할 수 있습니다.
  • std::input_iterator 을 모델링하는 객체에 대한 사후 증가의 반환 값은 부분적으로 형성된(이후 전진된 반복자의 복사본) 경우 이러한 객체에 대해 유효한 유일한 작업은 소멸과 새 반복자의 할당뿐입니다. 따라서 사후 증가 연산자는 반복자를 전진시키고 void 을 반환합니다.
  • 무작위 액세스를 허용하지 않음
  • 범위 지정 루프 또는 무작위 액세스 반복자가 필요하지 않은 C++20 std::범위 알고리즘에서 사용할 수 있습니다.
  • 유효한 이터레이터를 역참조하면 다음을 반환합니다 const DirEntry &
  • (c)end()는 반복의 끝을 알리는 QDirListing::sentinel 을 반환합니다. end ()와 동일하게 비교되는 반복자를 역참조하는 것은 정의되지 않은 동작입니다.

참고: "클래식" STL 알고리즘은 이터레이터/센티넬을 지원하지 않으므로 QDirListing 에 C++20 std::ranges 알고리즘을 사용하거나 C++17에서 범위 기반 알고리즘을 제공하는 서드파티 라이브러리를 사용해야 합니다.

QDirListing, QDirListing::sentinel, QDirListing::DirEntry참조하세요 .

멤버 유형 문서

[alias] const_iterator::pointer

const QDirListing::DirEntry * 에 대한 typedef입니다.

[alias] const_iterator::reference

const QDirListing::DirEntry & 에 대한 타입 정의입니다.

멤버 함수 문서

QDirListing::const_iterator::reference const_iterator::operator*() const

이터레이터가 가리키는 디렉터리 항목의 const QDirListing::DirEntry & 을 반환합니다.

QDirListing::const_iterator &const_iterator::operator++()

사전 증가 연산자. 반복자를 전진시키고 반복자에 대한 참조를 반환합니다.

void const_iterator::operator++(int)

사후 증가 연산자.

QDirListing::const_iterator 모델 C++20 std::input_iterator, 즉 임의 액세스를 허용하지 않는 이동 전용, 정방향 전용, 단일 패스 이터레이터입니다.

std::input_iterator 을 모델링하는 객체에 대한 사후 증가의 반환 값은 부분적으로 형성된(이후 진행된 반복자의 복사본) 객체이며, 이러한 객체에 대해 유효한 유일한 연산은 소멸과 새 반복자의 할당뿐입니다. 따라서 사후 증가 연산자는 반복자를 전진시키고 void 을 반환합니다.

QDirListing::const_iterator::pointer const_iterator::operator->() const

이터레이터가 가리키는 디렉터리 항목에 const QDirListing::DirEntry * 을 반환합니다.

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