std::begin(std::initializer_list)
Std::开始%28std::初始化器[医]名单%29
template< class E > const E* begin( initializer_list | | (since C++11) (until C++14) |
---|---|---|
template< class E > constexpr const E* begin( initializer_list<E> il ) noexcept; | | (since C++14) |
过载std::begin
为initializer_list
返回指向il
...
参数
il | - | an initializer_list |
---|
返回值
il.begin()
...
例
二次
#include <iostream>
#include <initializer_list>
int main()
{
std::initializer_list<int> il = {3, 1, 4, 1};
for(auto it = std::begin(il it != std::end(il ++it) {
std::cout << *it << '\n';
}
}
二次
产出:
二次
3
1
4
1
二次
另见
begin | returns a pointer to the first element (public member function) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。