File tree Expand file tree Collapse file tree 10 files changed +284
-65
lines changed Expand file tree Collapse file tree 10 files changed +284
-65
lines changed Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2024-11-20T11:48:00 ">
204
- 2024年11月20日 11時48分00秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -249,6 +249,12 @@ <h2>効果</h2>
249
249
</ p >
250
250
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
251
251
< p > 挿入されたかどうかを示す < code > bool</ code > と、挿入された要素へのイテレータからなる < code > < a href ="../../utility/pair.html "> pair</ a > </ code > を返す。挿入されなかったときは、既存要素へのイテレータを返す。</ p >
252
+ < h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
253
+ < p > 操作の前のコンテナサイズ(< code > < a href ="size.html "> size()</ a > </ code > )を< code > N</ code > とすると</ p >
254
+ < ul >
255
+ < li > 新しい要素が挿入された場合: < code > N</ code > に対して線形</ li >
256
+ < li > 要素の挿入が行われなかった場合: < code > N</ code > に対して対数</ li >
257
+ </ ul >
252
258
< h2 > 例</ h2 >
253
259
< h3 > 単純なキー・値を挿入する例</ h3 >
254
260
< p > < div class ="yata " id ="1b70ba2d8c5525ed94978dc552096935067e58b4 "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../iostream.html "> <iostream></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2023-08-17T08:14:08 ">
204
- 2023年08月17日 08時14分08秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> Akira Takahashi </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -239,7 +239,7 @@ <h2>パラメータ</h2>
239
239
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
240
240
< p > 新たな要素が追加された場合、その追加された要素を指すイテレータ。新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。</ p >
241
241
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
242
- < p > 一般にコンテナのサイズについて対数時間だが、新しい要素が < code > hint < /code > の前に挿入された場合は償却定数時間 。</ p >
242
+ < p > 操作の前のコンテナサイズ( < code > < a href =" size.html " > size() </ a > </ code > )を < code > N < /code > とすると、 < code > O(N) </ code > (挿入が行われなかった場合は < code > O(log N) </ code > より小さくなる可能性がある) 。</ p >
243
243
< h2 > 備考</ h2 >
244
244
< ul >
245
245
< li > < code > < a href ="try_emplace.html "> try_emplace</ a > </ code > と異なり、たとえ要素が挿入されなかった場合でも < code > value_type</ code > 型のオブジェクトが構築される可能性があり、結果として引数 < code > args</ code > が < code > < a href ="../../utility/move.html "> move</ a > </ code > の対象となって変更されてしまっている可能性があるため、注意が必要である。</ li >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-01-30T11:22:25 ">
204
- 2025年01月30日 11時22分25秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -241,6 +241,8 @@ <h2><a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成
241
241
</ ul >
242
242
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
243
243
< p > 挿入された要素へのイテレータを返す。</ p >
244
+ < h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
245
+ < p > コンテナサイズ(< code > < a href ="size.html "> size()</ a > </ code > )に対して線形</ p >
244
246
< h2 > 例</ h2 >
245
247
< p > < div class ="yata " id ="7522fc32ad84a38d27586a7ec90ffb4966696c26 "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_map.html "> <flat_map></ a > </ span > < span class ="cp "> </ span >
246
248
< span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../iostream.html "> <iostream></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-01-30T11:22:25 ">
204
- 2025年01月30日 11時22分25秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -239,7 +239,7 @@ <h2>パラメータ</h2>
239
239
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
240
240
< p > 追加された要素を指すイテレータ。</ p >
241
241
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
242
- < p > 一般にコンテナのサイズについて対数時間だが、新しい要素が < code > hint </ code > の前に挿入された場合は償却定数時間。 </ p >
242
+ < p > コンテナサイズ( < code > < a href =" size.html " > size() </ a > </ code > )に対して線形 </ p >
243
243
< h2 > 例</ h2 >
244
244
< p > < div class ="yata " id ="81d9aba9af53e51d9315e931e6373dcb270ce2e2 "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_map.html "> <flat_map></ a > </ span > < span class ="cp "> </ span >
245
245
< span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../iostream.html "> <iostream></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-02-06T17:10:03 ">
204
- 2025年02月06日 17時10分03秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -241,6 +241,8 @@ <h2><a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成
241
241
</ ul >
242
242
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
243
243
< p > 挿入された要素へのイテレータを返す。</ p >
244
+ < h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
245
+ < p > コンテナサイズ(< code > < a href ="size.html "> size()</ a > </ code > )に対して線形</ p >
244
246
< h2 > 例</ h2 >
245
247
< h3 > 単純な挿入の例</ h3 >
246
248
< p > < div class ="yata " id ="027cc762ca73f194600f4600b6275a62777fd500 "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_set.html "> <flat_set></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-02-06T17:10:03 ">
204
- 2025年02月06日 17時10分03秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -239,7 +239,7 @@ <h2>パラメータ</h2>
239
239
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
240
240
< p > 追加された要素を指すイテレータ。</ p >
241
241
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
242
- < p > 一般にコンテナのサイズについて対数時間だが、新しい要素が < code > hint </ code > の前に挿入された場合は償却定数時間。 </ p >
242
+ < p > コンテナサイズ( < code > < a href =" size.html " > size() </ a > </ code > )に対して線形 </ p >
243
243
< h2 > 例</ h2 >
244
244
< p > < div class ="yata " id ="0c236420ae22ab009eac9f2c5038827151ba237b "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_set.html "> <flat_set></ a > </ span > < span class ="cp "> </ span >
245
245
< span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../iostream.html "> <iostream></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-02-06T17:10:03 ">
204
- 2025年02月06日 17時10分03秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -247,6 +247,12 @@ <h2>効果</h2>
247
247
</ p >
248
248
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
249
249
< p > 挿入されたかどうかを示す < code > bool</ code > と、挿入された要素へのイテレータからなる < code > < a href ="../../utility/pair.html "> pair</ a > </ code > を返す。挿入されなかったときは、既存要素へのイテレータを返す。</ p >
250
+ < h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
251
+ < p > 操作の前のコンテナサイズ(< code > < a href ="size.html "> size()</ a > </ code > )を< code > N</ code > とすると</ p >
252
+ < ul >
253
+ < li > 新しい要素が挿入された場合: < code > N</ code > に対して線形</ li >
254
+ < li > 要素の挿入が行われなかった場合: < code > N</ code > に対して対数</ li >
255
+ </ ul >
250
256
< h2 > 例</ h2 >
251
257
< h3 > 単純な挿入の例</ h3 >
252
258
< p > < div class ="yata " id ="8c2efd5fbc0057f6d2d32241f387fe18f3889c4f "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_set.html "> <flat_set></ a > </ span > < span class ="cp "> </ span >
Original file line number Diff line number Diff line change 200
200
201
201
< p class ="text-right "> < small >
202
202
最終更新日時(UTC):
203
- < span itemprop ="datePublished " content ="2025-02-06T17:10:03 ">
204
- 2025年02月06日 17時10分03秒
203
+ < span itemprop ="datePublished " content ="2025-07-07T14:29:20 ">
204
+ 2025年07月07日 14時29分20秒
205
205
</ span >
206
206
< br />
207
207
< span itemprop ="author " itemscope itemtype ="http://schema.org/Person ">
208
- < span itemprop ="name "> suomesta </ span >
208
+ < span itemprop ="name "> onihusube </ span >
209
209
</ span >
210
210
が更新
211
211
</ small > </ p >
@@ -239,7 +239,7 @@ <h2>パラメータ</h2>
239
239
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数呼び出し式の評価結果となるオブジェクト・値 "> 戻り値</ a > </ h2 >
240
240
< p > 新たな要素が追加された場合、その追加された要素を指すイテレータ。新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。</ p >
241
241
< h2 > < a class ="cpprefjp-defined-word " data-desc ="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量 "> 計算量</ a > </ h2 >
242
- < p > 一般にコンテナのサイズについて対数時間だが、新しい要素が < code > hint < /code > の前に挿入された場合は償却定数時間 。</ p >
242
+ < p > 操作の前のコンテナサイズ( < code > < a href =" size.html " > size() </ a > </ code > )を < code > N < /code > とすると、 < code > O(N) </ code > (挿入が行われなかった場合は < code > O(log N) </ code > より小さくなる可能性がある) 。</ p >
243
243
< h2 > 例</ h2 >
244
244
< p > < div class ="yata " id ="1804cb64305d824ca91ee6633be81ad5851a139d "> < div class ="codehilite "> < pre > < span > </ span > < code > < span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../flat_set.html "> <flat_set></ a > </ span > < span class ="cp "> </ span >
245
245
< span class ="cp "> #include</ span > < span class ="cpf "> < a href ="../../iostream.html "> <iostream></ a > </ span > < span class ="cp "> </ span >
You can’t perform that action at this time.
0 commit comments