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

std::forward_list::clear

void clear();

?

(since C++11)

从容器中移除所有元素。

使引用、指针或迭代器引用包含的元素无效。任何过去的迭代器都是有效的.

参数

%280%29

返回值

%280%29

例外

noexcept规格:

noexcept

复杂性

容器的大小成线性。

缺陷报告

以下行为更改缺陷报告追溯应用于先前发布的C++标准。

DR

Applied to

Behavior as published

Correct behavior

LWG 2231

C++11

complexity guarantee was mistakenly omitted in C++11

complexity reaffirmed as linear

另见

erase_after

erases an element after an element (public member function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com