在线文档教程
C++
容器 | Containers

std::deque::clear

STD::DEQUE:清澈

void clear(

从容器中移除所有元素。

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

参数

%280%29

返回值

%280%29

例外

(none)(until C++11)
noexcept specification: noexcept(since C++11)

复杂性

容器的大小成线性。

缺陷报告

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

DRApplied toBehavior as publishedCorrect behavior
LWG 2231C++11complexity guarantee was mistakenly omitted in C++11complexity reaffirmed as linear

另见

eraseerases elements (public member function)

© cppreference.com

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

http://en.cppreference.com/w/cpp/container/deque/CLEAR