STD::_DEQUE_ITERATOR(3cxx)
π
std::_Deque_it...p, _Ref, _Ptr > β the 3cxx manual, bestie!! β¨
okay so this is the group chat for std::_Deque_iterator< _Tp, _Ref, _Ptr >, manual page 3cxx. She is the iterator brain cell for deque, and yes she is serving main-character energy. π«Ά
πΈ NAME πΈ
std::_Deque_iterator< _Tp, _Ref, _Ptr > β A deque::iterator. No cap, that's the whole name vibe. π
β¨ SYNOPSIS β¨
First things first, you gotta bring in the header:
#include <deque>
π Public Types π
typedef __ptr_rebind< _Ptr, _Tp > _Elt_pointertypedef __ptr_rebind< _Ptr, _Elt_pointer > _Map_pointertypedef _Deque_iterator _Selftypedef __iter< const _Tp > const_iteratortypedef ptrdiff_t difference_typetypedef __iter< _Tp > iteratortypedef std::random_access_iterator_tag iterator_categorytypedef _Ptr pointertypedef _Ref referencetypedef size_t size_typetypedef _Tp value_type
π Public Member Functions π
_Deque_iterator (_Elt_pointer __x, _Map_pointer __y) noexcept_Deque_iterator (const _Deque_iterator &__x) noexcept
the template constructor is its own lil diva, exact signature bestie:
template<typename _Iter , typename = _Require<is_same<_Self,
const_iterator>, is_same<_Iter, iterator>>>
_Deque_iterator (const _Iter &__x) noexcept
iterator _M_const_cast () const noexceptvoid _M_set_node (_Map_pointer __new_node) noexceptreference operator* () const noexcept_Self & operator++ () noexcept_Self operator++ (int) noexcept_Self & operator+= (difference_type __n) noexcept_Self & operator-- () noexcept_Self operator-- (int) noexcept_Self & operator-= (difference_type __n) noexceptpointer operator-> () const noexcept_Deque_iterator & operator= (const _Deque_iterator &)=defaultreference operator[] (difference_type __n) const noexcept
π§ Static Public Member Functions π§
static size_t _S_buffer_size () noexcept
π Public Attributes π
_Elt_pointer _M_cur_Elt_pointer _M_first_Elt_pointer _M_last_Map_pointer _M_node
π¦ Friends π¦
_Self operator+ (const _Self &__x, difference_type __n) noexcept_Self operator+ (difference_type __n, const _Self &__x) noexcept
template friend operator-, exact:
template<typename _RefR , typename _PtrR > difference_type operator-
(const _Self &__x, const _Deque_iterator< _Tp, _RefR, _PtrR > &__y)
noexcept
difference_type operator- (const _Self &__x, const _Self &__y) noexcept_Self operator- (const _Self &__x, difference_type __n) noexceptstrong_ordering operator<=> (const _Self &__x, const _Self &__y) noexcept
template friend operator==, exact:
template<typename _RefR , typename _PtrR > bool operator== (const _Self
&__x, const _Deque_iterator< _Tp, _RefR, _PtrR > &__y) noexcept
bool operator== (const _Self &__x, const _Self &__y) noexcept
π§ Detailed Description π§
the template + struct line is literally this, bestie:
template<typename _Tp, typename _Ref, typename _Ptr>
struct std::_Deque_iterator< _Tp, _Ref, _Ptr >
and the description line in the source has that lil quote energy: "A deque::iterator.
so like, there is quite a bit of intelligence here. Much of the functionality of deque is actually passed off to this class. A deque holds two of these internally, marking its valid range. Access to elements is done as offsets of either of those two, relying on operator overloading in this class. periodt.
All the functions are op overloads except for _M_set_node. that's the rule, iykyk. π
π Member Function Documentation π
π _M_set_node β the one non-op-overload icon
exact signature, no edits:
template<typename _Tp , typename _Ref , typename _Ptr > void
std::_Deque_iterator< _Tp, _Ref, _Ptr >::_M_set_node (_Map_pointer
__new_node) [inline], [noexcept]
what she does: prepares to traverse new_node. Sets everything except _M_cur, which should therefore be set by the caller immediately afterwards, based on _M_first and _M_last. that's the whole assignment, bestie. π«Ά
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. she was built by the machine, not by us. iconic. π€π
footer sign-off: source/version vibes from libstd, manual section 3cxx, and the date slot is not shown on this footer β she left it on read π. stay slay, bestie β¨π
π
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms