Skip to content

Commit

Permalink
fix: unordered_mapのoperator[]の例外仕様を修正
Browse files Browse the repository at this point in the history
例外を投げない仕様はないが、ハッシュ関数以外が例外を投げた場合は
insertには副作用がないという規定がある
ref: [unord.req.except]
  • Loading branch information
sf624 committed Jul 27, 2023
1 parent 4be1d11 commit 206dcff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions reference/unordered_map/unordered_map/op_at.md
Expand Up @@ -17,8 +17,7 @@ T& operator[](key_type&& x);
キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。

## 例外
投げない。

ハッシュ関数以外から例外が投げられた場合には、対応する要素がない場合の新規要素の挿入処理は実施されない。

## 計算量
- 平均: 定数時間
Expand Down

0 comments on commit 206dcff

Please sign in to comment.