std::initia...list::begin(3)
β¨ NAME β¨
okay so this is std::initia...list::begin(3), bestie β the std::initializer_list::begin page from the C++ Standard Libary. The NAME is literally std::initializer_list::begin - std::initializer_list::begin, because it ate and left no crumbs. π
πΈ Synopsis πΈ
const T* begin() const noexcept; (since C++11)
(until C++14)
constexpr const T* begin() const noexcept; (since C++14)
Returns a pointer to the first element in the initializer list. π«Ά
β οΈ If the initializer list is empty, the values ofbegin()andend()are unspecified, but will be identical. No cap β theyβll match, the actual value just isnβt promised. π
π Parameters π
(none)β literally none, bestie. β¨
π¦ Return value π¦
a pointer to the first element in the initializer list β iconic pointer behavior, fr fr. π
π₯ Complexity π₯
Constant. Thatβs it. Periodt. π
π Example π
// Run this code
#include <initializer_list>
int main()
{
static constexpr auto il = {42, 24};
static_assert(*il.begin() == 0x2A);
}
π See also π
endβ returns a pointer to one past the last element (public member function). Obsessed with the symmetry. β¨
mwah π β this std::initia...list::begin(3) moment was sourced from http://cppreference.com, version/date 2024.06.10. π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms