STD::_LIST_ITERATOR(3)
π std::_List_iterator< _Tp > π
okay bestie, welcome to the libstdc++ manual page for std::_List_iterator< _Tp > β she's a list::iterator, she's iconic, she lives in <list>, and she is literally just vibing in the standard library waiting for you to walk her through your linked list. no cap. π¦
β¨ NAME β¨
std::_List_iterator< _Tp > β a list::iterator. that's it, that's the whole job description. she iterates. periodt. π
πΈ SYNOPSIS πΈ
#include <list>
π Public Types π
bestie she has a whole wardrobe of typedefs, and every single one of them is serving exactly what it's supposed to:
typedef _List_node< _Tp > _Nodeβ the node type she's cruising around on. her ride. her little home base. πtypedef ptrdiff_t difference_typeβ the signed integer type for measuring distance between iterators. yes,ptrdiff_t, the classic. πtypedef std::bidirectional_iterator_tag iterator_categoryβ and THIS is the important one, because she's taggedbidirectional_iterator_tag, meaning she can walk forward AND backward. two directions. main character energy fr fr. π₯typedef _Tp * pointerβ pointer to the element type._Tp *. as promised. β¨typedef _Tp & referenceβ reference to the element type._Tp &. matching set, obsessed. πtypedef _Tp value_typeβ the actual element type being stored. the whole point of the operation. π
π«Ά Public Member Functions π«Ά
every single one of these is noexcept, which means she is NOT going to throw at you. she's chill like that. π
_List_iterator (__detail::_List_node_base *__x) noexceptβ constructor bestie!! hand her a__detail::_List_node_base *named__xand she'll wrap herself around it. that's the whole construction arc. π_List_iterator _M_const_cast () const noexceptβ internal magic (that_M_prefix is the giveaway, iykyk) that hands you back a_List_iteratorfrom aconstcontext. she's aconstmember function, and she does not throw. π§reference operator* () const noexceptβ the dereference glow-up!! gives you areferenceto the thing she's pointing at.const, and yes,noexcept. β_List_iterator & operator++ () const noexceptβ wait bestie, read that again, it's aconstmember function that returns_List_iterator &. pre-increment!! move forward, return yourself. slay. β¨_List_iterator operator++ (int) noexceptβ post-increment!! that lonelyintparameter is the classic dummy argument that exists purely so the compiler can tell the two++versions apart. she returns a_List_iteratorby value β the old position, preserved like a little polaroid. πΈ_List_iterator & operator-- () const noexceptβ pre-decrement!! going backwards, also aconstmember function, also returns_List_iterator &. bidirectional, remember? told you. π_List_iterator operator-- (int) noexceptβ post-decrement, sameintdummy-argument trick, returns the pre-decrement copy by value. iconic behaviour, honestly. πpointer operator-> () const noexceptβ the arrow!! gives you apointerso you can reach straight through to a member.const,noexcept, perfect. π
π Public Attributes π
just one, and she's doing a LOT of heavy lifting:
__detail::_List_node_base * _M_nodeβ the raw pointer to the node base. this is the whole entire state of the iterator. everything above is just choreography around this one pointer. respect her. π
π Friends π
bool operator== (const _List_iterator &__x, const _List_iterator &__y) noexceptβ equality comparison between two iterators, taking__xand__y, returningbool, and (say it with me)noexcept. friendship means she gets to peek at your privates. that's the C++ way. π
π¦ Detailed Description π¦
template<typename _Tp>
struct std::_List_iterator< _Tp >
"A list::iterator.
All the functions are op overloads."
yeah. that's the whole thing. all the functions are op overloads β every single member function up there is an operator overload. *, ++, --, ->, all of it. she doesn't have a personality beyond operators, and honestly? she doesn't need one. she ate and left no crumbs. π
βοΈ Author βοΈ
Generated automatically by Doxygen for libstdc++ from the source code. so like, no human wrote this by hand β Doxygen did it, machine-style, no cap. π€β¨
bestie quick recap so you don't forget:#include <list>, bidirectional,noexcepteverything, one single_M_nodeattribute holding the whole vibe together, and a friendoperator==. that's her. that's the iterator. π
okay that's a wrap!! this page came to you from libstdc++ (the library, not a date β the footer's just repping the source, she's timeless like that π
) and yes, the footer also says std::_List...tor< _Tp >(3) because the title got truncated on the way out, and honestly? relatable. mwah. ππ
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms