std::filesy...::operator*,(3)
π std::filesy...::operator*,(3) π
okay bestie, this is a C++ Standard Libary manual page, section (3). Yes, the manual name is right there near the top, and yes, we're about to talk about std::filesystem::recursive_directory_iterator's operator* and operator->. It's giving filesystem main character energy. π¦
πΈ NAME πΈ
Literally these lines, dash and all:
std::filesystem::recursive_directory_iterator::operator*, -
std::filesystem::recursive_directory_iterator::operator*,
So yeah β this page is the operator* / operator-> moment for std::filesystem::recursive_directory_iterator. Periodt. π
β¨ Synopsis β¨
const std::filesystem::directory_entry& operator*() const; (1)
(since C++17)
const std::filesystem::directory_entry* operator->() const; (2)
(since C++17)
okay so line (1) is the operator* signature and line (2) is the operator-> signature, both marked (since C++17).
This accesses the pointed-to directory_entry β that's the whole point, bestie.
β οΈ The result ofoperator*oroperator->on the end iterator is undefined behavior. Not a drill. Not cute. Do not collect $200. π
π Parameters π
(none) β literally no parameters. Slay. β¨
π Return value π
- Value of the
directory_entryreferred to by this iterator. - Pointer to the
directory_entryreferred to by this iterator.
So (1) gives you the value, (2) gives you the pointer. Simple, clean, iconic. π«Ά
π₯ Exceptions π₯
May throw implementation-defined exceptions. So the implementation gets to choose the drama, and honestly? Rude. π
π See also π
operator*β accesses the pointed-to entryoperator->β public member function ofstd::filesystem::directory_iterator
xoxo, bestie π β that was std::filesy...::operator*,(3), source: http://cppreference.com, version/date: 2024.06.10. mwah π
π¦ 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