std::filesy...operator++,(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

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.

  1. Throws std::filesystem::filesystem_error on underlying OS API errors, constructed with the OS error code as the error code argument.
  2. Sets a std::error_code& parameter to the OS API error code if an OS API call fails, and executes ec.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_code overload marked noexcept but can allocate memory
    • Correct behavior: noexcept removed

🏷️ Categories 🏷️

  • Todo without reason
  • Todo 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