STD::INITIALIZER_LIST(3cxx)

πŸŽ€ NAME πŸŽ€

std::initializer_list< _E > β€” bestie, it's initializer_list πŸ’…

(this is the std::initializer_list< _E >(3cxx) page, from the libstdc++ manual β€” section 3cxx, ok? now let's go ✨)


✨ SYNOPSIS ✨

okay so first things first, you gotta pull it in:

#include <initializer_list>

πŸ’– Public Types πŸ’–

these are the type aliases, no cap, exactly as written:

  • typedef const _E * const_iterator β€” a const iterator, it's giving read-only 🫢
  • typedef const _E & const_reference β€” const reference, same energy
  • typedef const _E * iterator β€” the iterator type πŸ‘€
  • typedef const _E & reference β€” the reference type
  • typedef size_t size_type β€” the size type, size_t, periodt
  • typedef _E value_type β€” the value type, literally just _E 🌸

πŸ¦‹ Public Member Functions πŸ¦‹

the whole squad of member functions, all constexpr and all noexcept (iconic of them honestly):

  • constexpr const_iterator begin () const noexcept β€” gives you the iterator to the front πŸ”₯
  • constexpr const_iterator end () const noexcept β€” gives you the iterator past-the-end ⭐
  • constexpr size_type size () const noexcept β€” how many elements, fr fr
heads up bestie β€” these are not member symbols, ok? they just hang out nearby πŸ‘‘
  • template<class _Tp > constexpr const _Tp * begin (initializer_list< _Tp > __ils) noexcept β€” Return an iterator pointing to the first element of the initializer_list.
  • template<class _Tp > constexpr const _Tp * end (initializer_list< _Tp > __ils) noexcept β€” Return an iterator pointing to one past the last element of the initializer_list.

πŸ‘‘ Detailed Description πŸ‘‘

the class itself, looking exactly like this:

template<class _E>
    class std::initializer_list< _E >"initializer_list

(yes that's literally how it's printed on the page β€” I'm not touching it, iykyk πŸ™ˆ)


template<class _Tp > constexpr const _Tp * begin (initializer_list< _Tp > __ils)

Return an iterator pointing to the first element of the initializer_list.

Parameters

  • __ils β€” Initializer list.
template<class _Tp > constexpr const _Tp * end (initializer_list< _Tp > __ils)

Return an iterator pointing to one past the last element of the initializer_list.

Parameters

  • __ils β€” Initializer list.

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code. not a human wrote this one, bestie β€” the robots did it πŸ€–βœ¨


okay that's the whole vibe check, we ate and left no crumbs πŸ“ this was the libstdc++ std::initializer_list< _E >(3cxx) page β€” source and version: libstdc++, manual section 3cxx, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from