Namespaces
Variants

std::experimental::filesystem::path:: begin, std::experimental::filesystem::path:: end

From cppreference.net
iterator begin ( ) const ;
(1) (filesystem TS)
iterator end ( ) const ;
(2) (filesystem TS)
1) 경로의 첫 번째 요소에 대한 반복자를 반환합니다. 경로가 비어 있는 경우, 반환된 반복자는 end() 와 같습니다.
2) 경로의 마지막 요소 바로 다음을 가리키는 반복자를 반환합니다. 이 반복자를 역참조하는 것은 정의되지 않은 동작입니다.

이 반복자 쌍으로 표시되는 시퀀스는 다음으로 구성됩니다:

1) root-name (있는 경우).
2) root-directory (있는 경우).
3) file-name 시퀀스, 모든 디렉토리 구분자는 생략됩니다.
4) 경로의 마지막 file-name 뒤에 디렉토리 구분자가 있는 경우, end iterator 이전의 마지막 요소는 가상의 dot 파일 이름입니다.

목차

매개변수

(없음)

반환값

1) 경로의 첫 번째 요소에 대한 반복자.
2) 경로의 끝을 지난 Iterator.

예외

구현 정의 예외를 던질 수 있습니다.

예제

#include <experimental/filesystem>
#include <iostream>
namespace fs = std::experimental::filesystem;
int main()
{
    fs::path p = "C:\\users\\abcdef\\AppData\\Local\\Temp\\";
    std::cout << "Examining the path " << p << " through iterators gives\n";
    for (auto& e : p)
        std::cout << e << '\n';
}

출력:

Examining the path "C:\users\abcdef\AppData\Local\Temp\" through iterators gives
"C:"
"/"
"users"
"abcdef"
"AppData"
"Local"
"Temp"
"."