std::experi...y_iterator),(3)
πΈ NAME πΈ
okay so bestie, welcome to the C++ Standard Libary manual page for std::experi...y_iterator),(3) β yes, the header is truncated like that, weβre keeping the vibe, no cap. The NAME block is literally:
std::experimental::filesystem::begin(directory_iterator), -
std::experimental::filesystem::begin(directory_iterator),
(It really does say begin twice in the NAME block; Iβm not fixing it, Iβm just reporting it. π
)
β¨ Synopsis β¨
Two functions, both non-member, both filesystem TS, both here to make your range-based for loop era iconic:
directory_iterator begin( directory_iterator iter ); (1) (filesystem TS)
directory_iterator end( const directory_iterator& ); (2) (filesystem TS)
(1)returnsiterunchanged.(2)returns a default-constructeddirectory_iterator, which serves as the end iterator. The argument is ignored.
These non-member functions enable the use of directory_iterators with range-based for loops. π
π Parameters π
iterβ adirectory_iterator.
π¦ Return value π¦
iterunchanged.- End iterator (default-constructed
directory_iterator).
π«Ά Exceptions π«Ά
The noexcept specification is: noexcept.
Thatβs it β thatβs the whole section, and itβs giving unconditionally noexcept energy. The category list backs that up. π«Ά
π Example π
The page says // Run this code, so hereβs the code, bestie:
#include <experimental/filesystem>
#include <fstream>
#include <iostream>
namespace fs = std::experimental::filesystem;
int main()
{
fs::create_directories("sandbox/a/b");
std::ofstream("sandbox/file1.txt");
std::ofstream("sandbox/file2.txt");
for (auto& p : fs::directory_iterator("sandbox"))
std::cout << p << '\n';
fs::remove_all("sandbox");
}
β Possible output β
"sandbox/a"
"sandbox/file1.txt"
"sandbox/file2.txt"
π₯ See also π₯
filesystem::begin(filesystem::recursive_directory_iterator)β range-based for loopfilesystem::end(filesystem::recursive_directory_iterator)β support (function)
π Categories π
Noindexed pagesunconditionally noexcept
π Hidden categories π
Pages with unreviewed unconditional noexcept templatePages with unreviewed noexcept template
mwah π β source/version is http://cppreference.com, dated 2024.06.10, page std::experi...y_iterator),(3). stay hydrated and may your directory_iterator always find the end iterator exactly when it should. π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms