STD::FILESYSTEM_PATH_ITERATOR(3)

πŸ“¦ version 11.5.0, in centos-stream 9

πŸ’… std::filesystem::path::iterator β€” from the libstdc++ manual, bestie

okay so picture this: you're deep in std::filesystem and you need to walk a path piece by piece, like component by component, and you're out here thinking "surely there's a whole iterator for that." There is. It lives in libstdc++ and it's literally called std::filesystem::path::iterator. An iterator for the components of a path. That's the whole vibe. πŸ¦‹


✨ NAME ✨

std::filesystem::path::iterator β€” an iterator for the components of a path. That's it. That's the gig. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

🌸 Public Types

these are the type aliases it's serving, and you will respect them:

  • difference_type β€” using difference_type = std::ptrdiff_t
  • iterator_category β€” using iterator_category = std::bidirectional_iterator_tag (so yes bestie, it goes both ways πŸ‘‘)
  • pointer β€” using pointer = const path *
  • reference β€” using reference = const path &
  • value_type β€” using value_type = path

⭐ Public Member Functions

every single one, no skipping, iykyk:

  • iterator (const iterator &)=default β€” copy constructor, defaulted, doing exactly what it says on the tin
  • reference operator* () const β€” dereference it, get your reference back
  • iterator & operator++ () β€” prefix increment, returns a reference to this iterator
  • iterator operator++ (int) β€” postfix increment, returns a copy
  • iterator & operator-- () β€” prefix decrement, same deal, returns a reference
  • iterator operator-- (int) β€” postfix decrement, returns a copy
  • pointer operator-> () const β€” arrow operator, hands you a pointer
  • iterator & operator= (const iterator &)=default β€” copy assignment, defaulted, slay

🫢 Friends

these aren't just friends, they're friends-of-the-class friends:

void __path_iter_advance (iterator &__i, difference_type __n)
difference_type __path_iter_distance (const iterator &__first, const iterator &__last)
bool operator!= (const iterator &__lhs, const iterator &__rhs)
bool operator== (const iterator &__lhs, const iterator &__rhs)
class path
  • void __path_iter_advance (iterator &__i, difference_type __n) β€” advances __i by __n
  • difference_type __path_iter_distance (const iterator &__first, const iterator &__last) β€” the distance between __first and __last
  • bool operator!= (const iterator &__lhs, const iterator &__rhs) β€” inequality check between two iterators
  • bool operator== (const iterator &__lhs, const iterator &__rhs) β€” equality check between two iterators
  • class path β€” the class being friended, obviously, it's right there in the name of the whole thing πŸ’€

🧚 Detailed Description 🧚

An iterator for the components of a path. Fr fr. You point it at a path, you increment it, and it walks you through the components one at a time like it's reading your horoscope. Highkey iconic.

ngl there's not a ton more in this doc β€” what you see is what you get, and what you get is a bidirectional iterator over path components. no cap.

πŸ”₯ Author πŸ”₯

Generated automatically by Doxygen for libstdc++ from the source code. Not a human, not a vibe, just Doxygen doing its little thing. πŸ™ˆ


kisses bestie, this page was brought to you by libstdc++ and it was dated Wed Oct 7 2026 β€” go forth and iterate, mwah πŸ’‹

πŸ“¦ where this page comes from