STD::__DEBUG::VECTOR(3cxx)
π NAME π
okay so bestie, this is the 3cxx manual page for std::__debug::vector< _Tp, _Allocator > β aka Class std::vector with safety/checking/debug instrumentation. Yes, the debug-flavored vector. It's giving "normal vector but with a safety harness and a tiny clipboard". π
β¨ SYNOPSIS β¨
#include <vector>
Inherits from __gnu_debug::_Safe_container< _SafeContainer, _Alloc, _SafeBase, _IsCxx11AllocatorAware >, vector< _Tp, std::allocator< _Tp > >, and __gnu_debug::_Safe_vector< _SafeSequence, _BaseSequence >. No cap, that's the whole inheritance vibe. π«Ά
π Public Types π
typedef _Allocator allocator_typeβ the allocator type, slay.typedef __gnu_debug::_Safe_iterator< _Base_const_iterator, vector > const_iteratorβ safe const iterator wrapper.typedef _Base::const_pointer const_pointerβ the base's const pointer type.typedef _Base::const_reference const_referenceβ the base's const reference type.typedef std::reverse_iterator< const_iterator > const_reverse_iteratorβ reverse iterator overconst_iterator.typedef _Base::difference_type difference_typeβ difference type from_Base.typedef __gnu_debug::_Safe_iterator< _Base_iterator, vector > iteratorβ safe iterator wrapper.typedef _Base::pointer pointerβ the base's pointer type.typedef _Base::reference referenceβ the base's reference type.typedef std::reverse_iterator< iterator > reverse_iteratorβ reverse iterator overiterator.typedef _Base::size_type size_typeβ size type from_Base.typedef _Tp value_typeβ the element type, literally_Tp.
π Public Member Functions π
constexpr vector (_Base_ref __x)β Construction from a normal-mode vector.template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> constexpr vector (_InputIterator __first, _InputIterator __last, const _Allocator &__a=_Allocator())β range constructor with the allocator defaulted.constexpr vector (const _Allocator &__a) noexceptβ allocator-only constructor, noexcept.vector (const vector &)=defaultβ copy constructor, defaulted.constexpr vector (const vector &__x, const __type_identity_t< allocator_type > &__a)β copy-with-allocator constructor.constexpr vector (initializer_list< value_type > __l, const allocator_type &__a=allocator_type())β initializer-list constructor with allocator.constexpr vector (size_type __n, const __type_identity_t< _Tp > &__value, const _Allocator &__a=_Allocator())β__ncopies of__value, with allocator.constexpr vector (size_type __n, const _Allocator &__a=_Allocator())β__ndefault values, with allocator.vector (vector &&)=defaultβ move constructor, defaulted.constexpr vector (vector &&__x, const __type_identity_t< allocator_type > &__a) noexcept(std::is_nothrow_constructible< _Base, _Base, const allocator_type & >::value)β move-with-allocator constructor, with that exact conditional noexcept.constexpr const _Base & _M_base () const noexceptβ const base getter.constexpr _Base & _M_base () noexceptβ non-const base getter.template<typename _InputIterator , typename = std::_RequireInputIter<_InputIterator>> constexpr void assign (_InputIterator __first, _InputIterator __last)β range assign.constexpr void assign (initializer_list< value_type > __l)β initializer-list assign.constexpr void assign (size_type __n, const _Tp &__u)β assign__ncopies of__u.constexpr const_reference back () const noexceptβ constback.constexpr reference back () noexceptβ non-constback.constexpr const_iterator begin () const noexceptβ constbegin.constexpr iterator begin () noexceptβ non-constbegin.constexpr size_type capacity () const noexceptβ capacity, noexcept.constexpr const_iterator cbegin () const noexceptβ constcbegin.constexpr const_iterator cend () const noexceptβ constcend.constexpr void clear () noexceptβ clear it, noexcept.constexpr const_reverse_iterator crbegin () const noexceptβ const reversecrbegin.constexpr const_reverse_iterator crend () const noexceptβ const reversecrend.template<typename... _Args> constexpr iterator emplace (const_iterator __position, _Args &&... __args)β emplace at__position.template<typename... _Args> constexpr reference emplace_back (_Args &&... __args)β emplace at the back.constexpr const_iterator end () const noexceptβ constend.constexpr iterator end () noexceptβ non-constend.constexpr iterator erase (const_iterator __first, const_iterator __last)β erase the range.constexpr iterator erase (const_iterator __position)β erase one position.constexpr const_reference front () const noexceptβ constfront.constexpr reference front () noexceptβ non-constfront.template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> constexpr iterator insert (const_iterator __position, _InputIterator __first, _InputIterator __last)β insert a range at__position.template<typename _Up = _Tp> constexpr __gnu_cxx::__enable_if<!std::__are_same< _Up, bool >::__value, iterator >::__type insert (const_iterator __position, _Tp &&__x)β the_Up = _Tpinsert overload with the!std::__are_same< _Up, bool >enable_if.constexpr iterator insert (const_iterator __position, const _Tp &__x)β insert a const_Tpvalue.constexpr iterator insert (const_iterator __position, initializer_list< value_type > __l)β insert an initializer list.constexpr iterator insert (const_iterator __position, size_type __n, const _Tp &__x)β insert__ncopies of__x.vector & operator= (const vector &)=defaultβ copy assignment, defaulted.constexpr vector & operator= (initializer_list< value_type > __l)β initializer-list assignment.vector & operator= (vector &&)=defaultβ move assignment, defaulted.constexpr const_reference operator[] (size_type __n) const noexceptβ const subscript.constexpr reference operator[] (size_type __n) noexceptβ non-const subscript.constexpr void pop_back () noexceptβ pop the back, noexcept.template<typename _Up = _Tp> constexpr __gnu_cxx::__enable_if<!std::__are_same< _Up, bool >::__value, void >::__type push_back (_Tp &&__x)β the_Up = _Tppush_backoverload with that same enable_if.constexpr void push_back (const _Tp &__x)β push a const_Tpvalue.constexpr const_reverse_iterator rbegin () const noexceptβ const reverserbegin.constexpr reverse_iterator rbegin () noexceptβ non-const reverserbegin.constexpr const_reverse_iterator rend () const noexceptβ const reverserend.constexpr reverse_iterator rend () noexceptβ non-const reverserend.constexpr void reserve (size_type __n)β reserve__n.constexpr void resize (size_type __sz)β resize to__sz.constexpr void resize (size_type __sz, const _Tp &__c)β resize to__szwith__c.constexpr void shrink_to_fit ()β shrink to fit.constexpr void swap (vector &__x) noexcept(/*conditional */)β swap, with the conditional noexcept exactly as the page shows.
π‘οΈ Protected Member Functions π‘οΈ
bool _M_requires_reallocation (size_type __elements) const noexceptβ the reallocation-check helper, const noexcept.constexpr void _M_swap (_Safe_container &__x) noexceptβ swap with a_Safe_container, noexcept.constexpr void _M_update_guaranteed_capacity () noexceptβ updates the guaranteed capacity, noexcept.
π§ Protected Attributes π§
size_type _M_guaranteed_capacityβ the guaranteed-capacity member.
π€ Friends π€
template<typename _ItT , typename _SeqT , typename _CatT > class ::__gnu_debug::_Safe_iteratorβ friend class, bestie privileges.
π Detailed Description π
template<typename _Tp, typename _Allocator = std::allocator<_Tp>>
class std::__debug::vector< _Tp, _Allocator >
"Class std::vector with safety/checking/debug instrumentation." periodt. It's literally the debug container vibe: std::vector, but with safety/checking/debug instrumentation energy. π
π§ Constructor & Destructor Documentation π§
template<typename _Tp , typename _Allocator = std::allocator<_Tp>>
constexpr std::__debug::vector< _Tp, _Allocator >::vector (_Base_ref __x) [inline], [constexpr]
Construction from a normal-mode vector. That's the one with _Base_ref __x, and the docs mark it [inline], [constexpr]. Slay. β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human author, just Doxygen doing its thing. π
Sign-off bestie: source/version is libstdc++; date: the footer date field is truncated/mangled in this copy, so I'm not inventing one. π«Άβ¨
π¦ 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