std::filesy...operator++,(3)
okay bestie, welcome to the std::filesy...operator++,(3) page β it's from the C++ Standard Libary manual (yes, βLibaryβ is literally spelled that way in the header, and honestly? iconic π
). This is the C++ Standard Libraryβs std::filesystem::directory_iterator::operator++ situation, and weβre gonna get through it together, no cap π«Ά
π NAME π
std::filesystem::directory_iterator::operator++, - and std::filesystem::directory_iterator::operator++, β yeah, thatβs the name, comma chaos and all π. The page is filed under both strings, so weβre keeping both, fr fr.
πΈ Synopsis πΈ
directory_iterator& operator++(); (1) (since C++17)
directory_iterator& increment( std::error_code& ec ); (2) (since C++17)
Vibe check: it advances the iterator to the next entry. The way that it also invalidates all copies of the previous value of *this is very βmain character energy, but make it dangerousβ π.
Incomplete alert: This section is incomplete π
π§Έ Parameters π§Έ
ecβ error code to store error status to. Thatβs it, thatβs the parameter, slay.
π Return value π
*this β literally just *this, periodt. The function hands the iterator back to you π
π₯ Exceptions π₯
Real talk: any overload not marked noexcept may throw std::bad_alloc if memory allocation fails.
- Throws
std::filesystem::filesystem_erroron underlying OS API errors, constructed with the OS error code as the error code argument. - Sets a
std::error_code¶meter to the OS API error code if an OS API call fails, and executesec.clear()if no errors occur.
π¦ Example π¦
Incomplete alert: This section is incomplete π Reason: no example.
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
LWG 3013- Applied to: C++17
- Behavior as published:
error_codeoverload markednoexceptbut can allocate memory - Correct behavior:
noexceptremoved
π·οΈ Categories π·οΈ
Todo without reasonTodo no example
mwah π this little page came from http://cppreference.com, dated 2024.06.10, and itβs the std::filesy...operator++,(3) page β bye bestie, go iterate responsibly! ππ
π«Ά
π¦ 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