std::end(std::initializer_list)
From cppreference.com
< cpp | utility | initializer list
Defined in header <initializer_list>
|
||
template< class E > const E* end( std::initializer_list<E> il ) noexcept; |
(since C++11) (constexpr since C++14) |
|
The overload of std::end for initializer_list
returns a pointer to one past the last element of il.
Contents |
[edit] Parameters
il | - | an initializer_list
|
[edit] Return value
il.end()
[edit] Example
Run this code
#include <cassert> #include <initializer_list> #include <iterator> #include <numeric> int main() { std::initializer_list e = {2, 7, 1, 8, 2, 8, 1}; assert(std::accumulate(std::begin(e), std::end(e), 13) == 42); }
[edit] See also
returns a pointer to one past the last element (public member function) |