std::begin(...alizer_list)(3)
π std::begin(...alizer_list)(3) β C++ Standard Libary π
okay bestie, welcome to the std::begin(...alizer_list)(3) page from the C++ Standard Libary manual. itβs giving βtiny utility, main character energyβ and weβre gonna get into every detail fr fr. π
β¨ NAME β¨
std::begin(std::initializer_list) β std::begin(std::initializer_list)
πΈ Synopsis πΈ
Defined in header <initializer_list>.
Era 1, since C++11 and until C++14:
template< class E >
const E* begin( std::initializer_list<E> il ) noexcept;
Era 2, since C++14:
template< class E >
constexpr const E* begin( std::initializer_list<E> il ) noexcept;
The overload of std::begin for initializer_list returns a pointer to the first element of il. lowkey iconic, no cap. β¨
π Parameters π
ilβ aninitializer_list
π¦ Return value π¦
il.begin()
π Example π
// Run this code
#include <iostream>
#include <iterator>
#include <algorithm>
#include <initializer_list>
int main()
{
std::initializer_list il = {3, 1, 4, 1};
std::copy(std::begin(il),
std::end(il),
std::ostream_iterator<int>(std::cout, "\n"));
}
π¬ Output π¬
3
1
4
1
π See also π
beginβ returns a pointer to the first element (public member function)
xoxo, bestie π source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::begin(...alizer_list)(3) β periodt. π«Ά
π¦ 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