std::end(st...alizer_list)(3)
okay so this is std::end(std::initializer_list)(3), and the manual name is C++ Standard Libary β yes, spelled like that in the header, and we respect her π
.
β¨ NAME β¨
std::end(std::initializer_list) β std::end(std::initializer_list). She said it twice and honestly? Consistent queen behavior. π
π¦ Synopsis π¦
Defined in header <initializer_list> β periodt.
template< class E >
(since C++11)
const E* end( std::initializer_list<E> il ) noexcept;
(until C++14)
template< class E >
(since C++14)
constexpr const E* end( std::initializer_list<E> il ) noexcept;
The overload of std::end for initializer_list returns a pointer to one past the last element of il. Itβs giving pointer-to-one-past-the-end energy, and itβs noexcept, bestie. No cap. β¨
π Parameters π
ilβ aninitializer_list. Thatβs the whole parameter. Slay.
π§ Return value π§
il.end() β literally that. It returns il.end(). Iconic.
πΈ Example πΈ
// Run this code
#include <iostream>
#include <iterator>
#include <algorithm>
#include <initializer_list>
int main()
{
std::initializer_list il = {3, 1, 4, 1, 5, 9};
std::reverse_copy(std::begin(il),
std::end(il),
std::ostream_iterator<int>(std::cout, " "));
}
Output:
9 5 1 4 1 3
π See also π
endβ returns a pointer to one past the last element (public member function). Bestie, itβs right there in the name. π«Ά
source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::end(st...alizer_list)(3) β bye bestie, drink water and close your iterators πππ¦
π¦ 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