| Member types | ||||||
| Member constants | ||||||
| Member functions | ||||||
| Path decomposition | ||||||
| Non-member functions | ||||||
| ||||||
| Helper classes | ||||||
iterator begin()const; | (1) | (since C++17) |
iterator end()const; | (2) | (since C++17) |
The sequence denoted by this pair of iterators consists of the following:
Contents |
(none)
May throw implementation-defined exceptions.
#include <filesystem>#include <iostream>namespace fs= std::filesystem; int main(){const fs::path p=# ifdef _WIN32"C:\\users\\abcdef\\AppData\\Local\\Temp\\";# else"/home/user/.config/Cppcheck/Cppcheck-GUI.conf";# endifstd::cout<<"Examining the path "<< p<<" through iterators gives\n";for(auto it= p.begin(); it!= p.end();++it)std::cout<<*it<<" │ ";std::cout<<'\n';}
Possible output:
--- Windows ---Examining the path "C:\users\abcdef\AppData\Local\Temp\" through iterators gives"C:" │ "/" │ "users" │ "abcdef" │ "AppData" │ "Local" │ "Temp" │ "" │ --- UNIX ---Examining the path "/home/user/.config/Cppcheck/Cppcheck-GUI.conf" through iterators gives"/" │ "home" │ "user" │ ".config" │ "Cppcheck" │ "Cppcheck-GUI.conf" │