首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::end(std::initializer_list)

template< class E > const E* end( initializer_list<E> 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

二次

代码语言:javascript
复制
#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';
    }
}

二次

产出:

二次

代码语言:javascript
复制
3
1
4
1

二次

另见

end

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

代码语言:txt
复制
 ? cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com