__GNU_PARALLEL::_GUARDEDITERATOR(3cxx)

πŸ’… NAME πŸ’…

ok so bestie, meet __gnu_parallel::_GuardedIterator< _RAIter, _Compare > β€” it's an _Iterator wrapper supporting an implicit supremum at the end of the sequence, dominating all comparisons. yes that's a real sentence, and yes it's kind of iconic πŸ’–

this page lives in the libstdc++ manual, section 3cxx β€” noted, we'll circle back at the sign-off πŸŽ€


✨ SYNOPSIS ✨

#include <multiway_merge.h>

🫢 Public Member Functions

  • _GuardedIterator (_RAIter __begin, _RAIter __end, _Compare &__comp) β€” the Constructor. Sets iterator to beginning of sequence. hi bestie πŸ‘‹
  • operator _RAIter () const β€” Convert to wrapped iterator.
  • std::iterator_traits< _RAIter >::value_type & operator* () const β€” Dereference operator. yes queen, get the value πŸ’…
  • _GuardedIterator< _RAIter, _Compare > & operator++ () β€” Pre-increment operator.

πŸ¦‹ Friends

  • bool operator< (const _GuardedIterator< _RAIter, _Compare > &__bi1, const _GuardedIterator< _RAIter, _Compare > &__bi2) β€” Compare two elements referenced by guarded iterators.
  • bool operator<= (const _GuardedIterator< _RAIter, _Compare > &__bi1, const _GuardedIterator< _RAIter, _Compare > &__bi2) β€” Compare two elements referenced by guarded iterators.

🌸 Detailed Description 🌸

template<typename _RAIter, typename _Compare>
    class __gnu_parallel::_GuardedIterator< _RAIter, _Compare >

"_Iterator wrapper supporting an implicit supremum at the end of the sequence, dominating all comparisons."

ok so real talk: the implicit supremum comes with a performance cost. 😭 that's not me being dramatic, that's literally in the docs β€” the convenience has a price tag, ngl.

and why isn't this thing just derived from _RAIter like a normal class hierarchy moment? because deriving from _RAIter is not possible since _RAIter need not be a class. lowkey humbling πŸ™ˆ


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

_GuardedIterator (_RAIter __begin, _RAIter __end, _Compare & __comp) [inline]

template<typename _RAIter , typename _Compare >
    __gnu_parallel::_GuardedIterator< _RAIter, _Compare >::_GuardedIterator
    (_RAIter __begin, _RAIter __end, _Compare & __comp) [inline]

Constructor. Sets iterator to beginning of sequence. first-day-of-school energy fr fr ✨

Parameters

  • __begin β€” Begin iterator of sequence.
  • __end β€” End iterator of sequence.
  • __comp β€” Comparator provided for associated overloaded compare operators.

πŸ’œ Member Function Documentation πŸ’œ

operator _RAIter () const [inline]

template<typename _RAIter , typename _Compare >
    __gnu_parallel::_GuardedIterator< _RAIter, _Compare >::operator _RAIter
    () const [inline]

Convert to wrapped iterator. it's giving glow-up-to-your-true-form πŸ¦‹

Returns

Wrapped iterator.

operator* () const [inline]

template<typename _RAIter , typename _Compare > std::iterator_traits<
    _RAIter >::value_type & __gnu_parallel::_GuardedIterator< _RAIter,
    _Compare >::operator* () const [inline]

Dereference operator. the main character of operators, honestly πŸ‘‘

Returns

Referenced element.

operator++ () [inline]

template<typename _RAIter , typename _Compare > _GuardedIterator< _RAIter,
    _Compare > & __gnu_parallel::_GuardedIterator< _RAIter, _Compare
    >::operator++ () [inline]

Pre-increment operator. moving forward, always moving forward πŸ’…

Returns

This.


bool operator< (const _GuardedIterator< _RAIter, _Compare > & __bi1, const _GuardedIterator< _RAIter, _Compare > & __bi2) [friend]

template<typename _RAIter , typename _Compare > bool operator< (const
    _GuardedIterator< _RAIter, _Compare > & __bi1, const _GuardedIterator<
    _RAIter, _Compare > & __bi2) [friend]

Compare two elements referenced by guarded iterators. a little comparison date, we love to see it πŸ“

Parameters

  • __bi1 β€” First iterator.
  • __bi2 β€” Second iterator.

Returns

true if less.

bool operator<= (const _GuardedIterator< _RAIter, _Compare > & __bi1, const _GuardedIterator< _RAIter, _Compare > & __bi2) [friend]

template<typename _RAIter , typename _Compare > bool operator<= (const
    _GuardedIterator< _RAIter, _Compare > & __bi1, const _GuardedIterator<
    _RAIter, _Compare > & __bi2) [friend]

Compare two elements referenced by guarded iterators. same vibes, slightly more generous πŸ’–

Parameters

  • __bi1 β€” First iterator.
  • __bi2 β€” Second iterator.

Returns

true if less equal.


⭐ Author ⭐

Generated automatically by Doxygen for libstdc++ from the source code. not a human author, just Doxygen doing its little autogenerated thing πŸ€–βœ¨


ok that's the whole page, bestie β€” every member, every parameter, every [inline] and [friend], nothing skipped. go forth and guard those iterators 🫢

🌈 that's a wrap! this was the libstdc++ page for __gnu_parallel::_GuardedIterator< _RAIter, _Compare >, manual section 3cxx β€” mwah, slay, periodt πŸ’…πŸŽ€