docs: add ordered_map::erase to doc

This commit is contained in:
ToruNiina
2025-02-15 23:23:21 +09:00
parent 197e95d390
commit 91316213bf
2 changed files with 22 additions and 0 deletions

View File

@@ -281,6 +281,17 @@ Finds an element with the specified key and returns a reference to its value.
If the key is not found, a new value is constructed and returned.
If the `ordered_map` is `const`, throws `std::out_of_range` instead.
### `erase(...)`
```cpp
iterator erase(iterator pos);
iterator erase(const_iterator pos);
iterator erase(const_iterator first, const_iterator last);
size_type erase(const key_type& key);
```
Removes values pointed by an iterator or a value corresponding to a key.
### `key_comp()`
```cpp

View File

@@ -290,6 +290,17 @@ mapped_type const& operator[](const key_type& k) const;
`ordered_map``const` の場合は新規な値を構築できないので、 `std::out_of_range` を送出します。
### `erase(...)`
```cpp
iterator erase(iterator pos);
iterator erase(const_iterator pos);
iterator erase(const_iterator first, const_iterator last);
size_type erase(const key_type& key);
```
イテレータの指す位置の値、あるいはキーに該当する値を削除します。
### `key_comp()`
```cpp