__GNU_CXX::__DETAIL::__MINI_VECTOR(3cxx)

πŸ’… NAME πŸ’…

okay so <pink>__gnu_cxx::__detail::__mini_vector< _Tp ></pink> β€” bestie, it's literally a stripped-down, no-frills version of the full-fledged std::vector<>. like, the bare-minimum vector. the vector that woke up and chose simplicity. (this page lives in the <cyan>3cxx</cyan> section of the manual, iykyk πŸ’–)


✨ SYNOPSIS ✨

#include <bitmap_allocator.h>

πŸŽ€ Public Types πŸŽ€

so here's the whole type-squad, no cap:

  • typedef const _Tp & const_reference β€” a const reference to _Tp, obviously πŸ’…
  • typedef std::ptrdiff_t difference_type β€” yep, std::ptrdiff_t, the classic
  • typedef pointer iterator β€” plot twist: the iterator is just the pointer. iconic, honestly
  • typedef _Tp * pointer β€” raw _Tp pointer, keepin' it real
  • typedef _Tp & reference β€” a plain _Tp reference
  • typedef std::size_t size_type β€” std::size_t for all your sizing needs
  • typedef _Tp value_type β€” the value type is _Tp bestie, that's the whole vibe

πŸ¦‹ Public Member Functions πŸ¦‹

  • reference back () const throw () β€” gives you the last element, that's it 🌸
  • iterator begin () const throw () β€” where it all starts ✨
  • void clear () throw () β€” wipe it clean, throw () and everything
  • iterator end () const throw () β€” the end-of-the-road iterator 🫢
  • void erase (iterator __pos) throw () β€” yeet the element at __pos
  • void insert (iterator __pos, const_reference __x) β€” slide __x in at __pos (note: this one has no throw (), so, yeah πŸ‘€)
  • reference operator[] (const size_type __pos) const throw () β€” index into it, throw ()-style
  • void pop_back () throw () β€” bye-bye last element πŸ’€
  • void push_back (const_reference __x) β€” add __x to the end, main character energy
  • size_type size () const throw () β€” how many you got? πŸ‘‘

πŸ’œ Detailed Description πŸ’œ

template<typename _Tp>
class __gnu_cxx::__detail::__mini_vector< _Tp >

okay so <pink>__mini_vector<></pink> is a stripped down version of the full-fledged std::vector<>. periodt.

it is to be used only for built-in types or PODs. that's not a suggestion, that's the whole rule, fr fr. the notable differences are:

  1. not all accessor functions are present. like, she's minimal. that's the point πŸ’…
  2. used ONLY for PODs. (yes, again. it's that serious.)
  3. no Allocator template argument. she uses operator new() to get memory, and operator delete() to free it.
⚠️ caveat bestie please read this one: the dtor does NOT free the memory allocated, so this is a memory-leaking vector! 😭 like it will absolutely leak. that is documented behavior. do not come for me.

🌈 Author 🌈

generated automatically by Doxygen for libstdc++ from the source code. slay, robot ✨


and that's the page!! πŸŽ€ mwah πŸ’‹ β€” with love from the <hotpink>libstdc++</hotpink> girlies, as stamped in that footer (you know the one: libstd__gnu_cxx::__d...i_vector< _Tp >(3cxx)) πŸ«ΆπŸ’–