std::end(std::initializer_list)
STD::结束%28 std::初始化器[医]名单%29
template< class E > const E* end( initializer_list | | (since C++11) |
---|---|---|
template< class E > constexpr const E* end( initializer_list<E> il | | (since C++11) (until C++14) |
过载std::end
为initializer_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
二次
另见
end | returns a pointer to one past the last element (public member function) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。