iterator begin() const;
(1) (since C++17)iterator end() const;
(2) (since C++17)1) Returns an iterator to the first element of the path. If the path is empty, the returned iterator is equal to end().
2) Returns an iterator one past the last element of the path. Dereferencing this iterator is undefined behavior.
The sequence denoted by this pair of iterators consists of the following:
(none)
[edit] Return value1) Iterator to the first element of the path.
2) Iterator one past the end of the path
[edit] ExceptionsMay throw implementation-defined exceptions.
[edit] Example#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"; # endif std::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" â
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4