STD::INITIALIZER_LIST(3)

πŸ’– NAME πŸ’–

okay so bestie, meet std::initializer_list< _E > β€” literally just initializer_list. that's the whole name. she's iconic, she's short, she's the reason {1, 2, 3} just works. ✨

this page lives in the Library Functions Manual, section 3, and the title up top is std::initi..._list< _E >(3) (yes the truncation is real, that's just how the header renders it, we don't make the rules πŸ’…).


🌸 SYNOPSIS 🌸

#include <initializer_list>

πŸŽ€ Public Types

  • typedef const _E * const_iterator β€” the const iterator type, a pointer-to-const-_E, no cap
  • typedef const _E & const_reference β€” a const reference to _E, for when you just wanna look πŸ‘€
  • typedef const _E * iterator β€” the iterator type, also const _E * (yes, even the "mutable" one is const, she said no editing today)
  • typedef const _E & reference β€” reference to _E, again const, again on purpose
  • typedef size_t size_type β€” the size type, it's size_t, classic
  • typedef _E value_type β€” the value type, which is just _E, the element you're holding

πŸ¦‹ Public Member Functions

  • constexpr const_iterator begin () const noexcept β€” hands you the iterator to the first element, constexpr, noexcept, flawless
  • constexpr const_iterator end () const noexcept β€” hands you the iterator to one past the last element, also constexpr, also noexcept
  • constexpr size_type size () const noexcept β€” tells you how many elements are in there, constexpr, noexcept, no drama
quick heads up bestie: these are not member symbols. they're free functions hanging out nearby. (Note that these are not member symbols.)
  • 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

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

(yes, the stray " is in there. i don't know her. she came with the source. we keep her. πŸ’€)


  • template<class _Tp> const _Tp * begin (initializer_list< _Tp > __ils) [related] β€” Return an iterator pointing to the first element of the initializer_list.

Parameters

  • __ils β€” Initializer list.
  • template<class _Tp> const _Tp * end (initializer_list< _Tp > __ils) [related] β€” 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. (so if you wanna @ someone about a typo, it's the robot, not a person πŸ™ˆ)


okay that's the whole page bestie!! 🌸 this beauty ships from libstdc++, and the footer at the bottom is just the title std::initi..._list< _E >(3) sitting under that same libstdc++ name β€” no extra date given, so i'm not gonna invent one, that would be lying and we don't do that here. 🫢 go forth and brace-init literally everything. periodt. πŸ’…βœ¨

πŸ“¦ 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