STD::ITERATOR(3cxx)

πŸ’– NAME πŸ’–

std::iterator< _Category, _Tp, _Distance, _Pointer, _Reference > β€” literally the Common iterator class. 🫢

This is the std::iterator< ...r, _Reference > page, section 3cxx, bestie β€” welcome to the group chat ✨


🌸 SYNOPSIS 🌸

#include <iterator>

Inherited by std::istream_iterator< _Tp, _CharT, _Traits, _Dist >.

πŸŽ€ Public Types πŸŽ€

  • typedef _Distance difference_type β€” Distance between iterators is represented as this type. πŸ“
  • typedef _Category iterator_category β€” One of the tag types. 🏷️
  • typedef _Pointer pointer β€” This type represents a pointer-to-value_type. πŸ‘‰
  • typedef _Reference reference β€” This type represents a reference-to-value_type. 🫢
  • typedef _Tp value_type β€” The type 'pointed to' by the iterator. 🎯

✨ Detailed Description ✨

The signature is exactly this, no cap:

template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
    typename _Pointer = _Tp*, typename _Reference = _Tp&>
    struct std::iterator< _Category, _Tp, _Distance, _Pointer, _Reference
    >

The original then continues with the literal "Common iterator class. β€” yes, quote and all β€” and the whole vibe is: this class does nothing but define nested typedefs. Iterator classes can inherit from this class to save some work. The typedefs are then used in specializations and overloading. πŸ’…

In particular, there are no default implementations of requirements such as operator++ and the like. (How could there be?) 😭


πŸ¦‹ Member Typedef Documentation πŸ¦‹

πŸ“ difference_type

   template<typename _Category , typename _Tp , typename _Distance  =
       ptrdiff_t, typename _Pointer  = _Tp*, typename _Reference  = _Tp&>
       typedef _Distance std::iterator< _Category, _Tp, _Distance, _Pointer,
       _Reference >::difference_type

Distance between iterators is represented as this type. πŸ“

πŸ“ iterator_category

   template<typename _Category , typename _Tp , typename _Distance  =
       ptrdiff_t, typename _Pointer  = _Tp*, typename _Reference  = _Tp&>
       typedef _Category std::iterator< _Category, _Tp, _Distance, _Pointer,
       _Reference >::iterator_category

One of the tag types. 🏷️

πŸ“ pointer

   template<typename _Category , typename _Tp , typename _Distance  =
       ptrdiff_t, typename _Pointer  = _Tp*, typename _Reference  = _Tp&>
       typedef _Pointer std::iterator< _Category, _Tp, _Distance, _Pointer,
       _Reference >::pointer

This type represents a pointer-to-value_type. πŸ‘‰

πŸ“ reference

   template<typename _Category , typename _Tp , typename _Distance  =
       ptrdiff_t, typename _Pointer  = _Tp*, typename _Reference  = _Tp&>
       typedef _Reference std::iterator< _Category, _Tp, _Distance, _Pointer,
       _Reference >::reference

This type represents a reference-to-value_type. 🫢

πŸ“ value_type

   template<typename _Category , typename _Tp , typename _Distance  =
       ptrdiff_t, typename _Pointer  = _Tp*, typename _Reference  = _Tp&>
       typedef _Tp std::iterator< _Category, _Tp, _Distance, _Pointer,
       _Reference >::value_type

The type 'pointed to' by the iterator. 🎯


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code. πŸ€–βœ¨


Okay that's the whole page, mwah πŸ’‹. Footer tea: source/version is libstdc++, and the date is not printed on this manpage footer β€” so I'm not inventing one, fr fr. This was the std::iterator< ...r, _Reference > page from section 3cxx β€” bye bestie! 🫢🌈

πŸ“¦ where this page comes from