std:: end (std::initializer_list)
From cppreference.com
<
cpp
|
utility
|
initializer list
C++
Utilities library
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::initializer_list
| Member functions | ||||
| Capacity | ||||
| Iterators | ||||
| Non-member functions | ||||
|
end
(std::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
.
Parameters
| il | - |
an
initializer_list
|
Return value
il. end ( )
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); }
See also
|
returns a pointer to one past the last element
(public member function) |
Retrieved from "
https://en.cppreference.com/mwiki/index.php?title=cpp/utility/initializer_list/end2&oldid=177194
"