std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::clear
提供: cppreference.com
< cpp | container | unordered map
void clear()noexcept; | (C++11以上) | |
コンテナからすべての要素を削除します。 この呼び出しの後、 size() はゼロを返します。
格納されている要素を指すあらゆる参照、ポインタ、イテレータは無効化されます。 終端イテレータも無効化される場合があります。
目次 |
[編集]引数
(なし)
[編集]戻り値
(なし)
[編集]計算量
コンテナのサイズ、つまり要素数に比例。
欠陥報告
以下の動作変更欠陥報告は以前に発行された C++ 標準に遡って適用されました。
DR | 適用先 | 発行時の動作 | 正しい動作 |
---|---|---|---|
LWG 2550 | C++11 | for unordered associative containers, unclear if complexity is linear in the number of elements or buckets | clarified that it's linear in the number of elements |
[編集]関連項目
要素を削除します (パブリックメンバ関数) |