在线文档教程
C++
应用 | Utilities

std::end(std::initializer_list)

STD::结束%28 std::初始化器[医]名单%29

template< class E > const E* end( initializer_list il (since C++11)
template< class E > constexpr const E* end( initializer_list<E> il (since C++11) (until C++14)

过载std::endinitializer_list返回指向il...

参数

il-an initializer_list

返回值

il.end()...

例外

noexcept规格:

noexcept

二次

#include <iostream> int main() { // range-based for uses std::begin and std::end to iterate // over a given range; in this case, it's an initializer list for (int i : {3, 1, 4, 1}) { std::cout << i << '\n'; } }

二次

产出:

二次

3 1 4 1

二次

另见

endreturns a pointer to one past the last element (public member function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/实用程序/初始化器[医]清单/结束2