Skip to content

Commit 052205a

Browse files
Preview PR 1450: 457602ed6addf6
1 parent 0e8dcba commit 052205a

4 files changed

Lines changed: 51 additions & 128 deletions

File tree

gen/pull/1450/reference/chrono/make24.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ <h2>例</h2>
239239
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">,</span> <span class="nb">false</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">0h</a></span><span class="p">);</span>
240240

241241
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">);</span>
242-
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">1h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="n"><a href="duration/op_h.html">3h</a></span><span class="p">);</span>
242+
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">1h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1L</span><span class="n">NqteRWwUdtZOpElWnIyyowLlPEzgcRi</span><span class="p">);</span>
243243
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">3h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">15h</a></span><span class="p">);</span>
244244
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">11h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">23h</a></span><span class="p">);</span>
245245
<span class="p">}</span>

gen/pull/1450/reference/unordered_map/unordered_map/clear.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@
200200

201201
<p class="text-right"><small>
202202
最終更新日時(UTC):
203-
<span itemprop="datePublished" content="2025-05-28T13:54:36">
204-
2025年05月28日 13時54分36秒
203+
<span itemprop="datePublished" content="2025-05-29T16:50:47">
204+
2025年05月29日 16時50分47秒
205205
</span>
206206
<br/>
207207
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
208-
<span itemprop="name">koki watanabe</span>
208+
<span itemprop="name">Koki Watanabe</span>
209209
</span>
210210
が更新
211211
</small></p>
@@ -243,20 +243,18 @@ <h2><a class="cpprefjp-defined-word" data-desc="問題が発生したときに
243243
<h2><a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量">計算量</a></h2>
244244
<p>本関数呼び出し前のコンテナの要素数(<code><a href="size.html">size</a>()</code>)に比例</p>
245245
<h3><a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量">計算量</a>に関する備考</h3>
246-
<ul>
247-
<li>多くの実装(GCC libstdc++, LLVM libc++ など)は<ol>
246+
<p>多くの実装(GCC libstdc++, LLVM libc++ など)は</p>
247+
<ol>
248248
<li>全ての要素を走査して各要素を破棄</li>
249249
<li>全てのバケットを走査して各バケットの状態をリセット</li>
250250
</ol>
251-
</li>
252-
</ul>
253251
<p>という手順を取るため、実際の実行時間はバケット数 <code><a href="bucket_count.html">bucket_count</a>()</code> について線形となる (<code>size() &lt;= bucket_count() *<a href="max_load_factor.html">max_load_factor()</a></code> = O(<code>bucket_count()</code>) であることに注意)。
254252
規格の<a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量">計算量</a>の要件は要素数 <code>size()</code> に線形となっているが、規格がコンテナに対して定義する<a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量">計算量</a>は「コンテナに格納している要素に対する操作の数の<a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量">計算量</a>」であるためバケットの走査などを考慮していない。</p>
255253
<h2>備考</h2>
256254
<ul>
257255
<li><code>clear()</code> がバケット数(<code><a href="bucket_count.html">bucket_count</a>()</code>)を縮小することを規格は要求していない。
258256
実装によっては <code>clear()</code> 後もバケット配列が維持され、動的メモリが残る場合がある。</li>
259-
<li>バケット数を初期状態まで縮小させたいときには以下のように操作を行う</li>
257+
<li>バケット数を初期状態まで縮小させたいときには <code>clear()</code> の代わりに以下のように操作する</li>
260258
</ul>
261259
<p><div class="codehilite"><pre><span></span><code><span class="n">um</span> <span class="o">=</span> <span class="n"><a href="../unordered_map.html">std::unordered_map</a></span><span class="o">&lt;</span><span class="n"><a href="../../string/basic_string.html">std::string</a></span><span class="p">,</span> <span class="kt">int</span><span class="o">&gt;</span><span class="p">();</span>
262260
</code></pre></div>

gen/pull/1450/rss.xml

Lines changed: 43 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,51 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2025-05-28T13:58:38.606548</updated>
6-
<id>fe2e1645-42b4-4d2a-bbaf-85a02815011f</id>
5+
<updated>2025-05-29T16:54:46.446766</updated>
6+
<id>4531b15a-b3c0-4d72-a730-cb14d7719890</id>
77

88

9+
<entry>
10+
<title>clear -- Apply suggestions from code review</title>
11+
<link href="https://cpprefjp.github.io/reference/unordered_map/unordered_map/clear.html"/>
12+
<id>457602ec9ed561bf47cb0ad0877ceda8aa07408b:reference/unordered_map/unordered_map/clear.md</id>
13+
<updated>2025-05-30T01:50:47+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md
16+
index f4801435c..f7890756a 100644
17+
--- a/reference/unordered_map/unordered_map/clear.md
18+
+++ b/reference/unordered_map/unordered_map/clear.md
19+
@@ -37,9 +37,10 @@ void clear() noexcept;
20+
本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例
21+
22+
### 計算量に関する備考
23+
-- 多くの実装(GCC libstdc++, LLVM libc++ など)は
24+
- 1. 全ての要素を走査して各要素を破棄
25+
- 2. 全てのバケットを走査して各バケットの状態をリセット
26+
+多くの実装(GCC libstdc++, LLVM libc++ など)は
27+
+
28+
+1. 全ての要素を走査して各要素を破棄
29+
+2. 全てのバケットを走査して各バケットの状態をリセット
30+
31+
という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() &amp;lt;= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。
32+
規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。
33+
@@ -48,7 +49,7 @@ void clear() noexcept;
34+
## 備考
35+
- `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。
36+
実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。
37+
-- バケット数を初期状態まで縮小させたいときには以下のように操作を行う
38+
+- バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する
39+
```cpp
40+
um = std::unordered_map&amp;lt;std::string, int&amp;gt;();
41+
```
42+
&lt;/code&gt;&lt;/pre&gt;</summary>
43+
44+
<author>
45+
<name>Koki Watanabe</name>
46+
<email>56009584+math-hiyoko@users.noreply.github.com</email>
47+
</author>
48+
</entry>
49+
950
<entry>
1051
<title>clear -- fix: reflect discussions on the PR</title>
1152
<link href="https://cpprefjp.github.io/reference/unordered_map/unordered_map/clear.html"/>
@@ -390,120 +431,4 @@ index e91f81b0b..5f72a8196 100644
390431
</author>
391432
</entry>
392433

393-
<entry>
394-
<title>clear -- fix: minor fix</title>
395-
<link href="https://cpprefjp.github.io/reference/unordered_map/unordered_map/clear.html"/>
396-
<id>202823f1b3367e7eb4a9a9f7be0bbd14b493ad3a:reference/unordered_map/unordered_map/clear.md</id>
397-
<updated>2025-05-26T23:30:15+09:00</updated>
398-
399-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md
400-
index be2530f47..e91f81b0b 100644
401-
--- a/reference/unordered_map/unordered_map/clear.md
402-
+++ b/reference/unordered_map/unordered_map/clear.md
403-
@@ -38,8 +38,8 @@ void clear() noexcept;
404-
405-
### 計算量に関する備考
406-
- 多くの実装(GCC libstdc++, LLVM libc++ など)は
407-
- 1. 全ての要素を破棄する
408-
- 2. 全てのバケットを順に走査して各バケットを初期化
409-
+ 1. 全ての要素を走査して各要素を破棄
410-
+ 2. 全てのバケットを走査して各バケットを初期化
411-
412-
という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。
413-
規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。
414-
&lt;/code&gt;&lt;/pre&gt;</summary>
415-
416-
<author>
417-
<name>koki watanabe</name>
418-
<email>address8128@gmail.com</email>
419-
</author>
420-
</entry>
421-
422-
<entry>
423-
<title>clear -- fix: minor fix</title>
424-
<link href="https://cpprefjp.github.io/reference/unordered_map/unordered_multimap/clear.html"/>
425-
<id>202823f1b3367e7eb4a9a9f7be0bbd14b493ad3a:reference/unordered_map/unordered_multimap/clear.md</id>
426-
<updated>2025-05-26T23:30:15+09:00</updated>
427-
428-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md
429-
index ffa0832a4..3c02d091b 100644
430-
--- a/reference/unordered_map/unordered_multimap/clear.md
431-
+++ b/reference/unordered_map/unordered_multimap/clear.md
432-
@@ -38,8 +38,8 @@ void clear() noexcept;
433-
434-
### 計算量に関する備考
435-
- 多くの実装(GCC libstdc++, LLVM libc++ など)は
436-
- 1. 全ての要素を破棄する
437-
- 2. 全てのバケットを順に走査して各バケットを初期化
438-
+ 1. 全ての要素を走査して各要素を破棄
439-
+ 2. 全てのバケットを走査して各バケットを初期化
440-
441-
という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。
442-
規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。
443-
&lt;/code&gt;&lt;/pre&gt;</summary>
444-
445-
<author>
446-
<name>koki watanabe</name>
447-
<email>address8128@gmail.com</email>
448-
</author>
449-
</entry>
450-
451-
<entry>
452-
<title>clear -- fix: minor fix</title>
453-
<link href="https://cpprefjp.github.io/reference/unordered_set/unordered_multiset/clear.html"/>
454-
<id>202823f1b3367e7eb4a9a9f7be0bbd14b493ad3a:reference/unordered_set/unordered_multiset/clear.md</id>
455-
<updated>2025-05-26T23:30:15+09:00</updated>
456-
457-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md
458-
index 94488f299..8120d2c23 100644
459-
--- a/reference/unordered_set/unordered_multiset/clear.md
460-
+++ b/reference/unordered_set/unordered_multiset/clear.md
461-
@@ -38,8 +38,8 @@ void clear() noexcept;
462-
463-
### 計算量に関する備考
464-
- 多くの実装(GCC libstdc++, LLVM libc++ など)は
465-
- 1. 全ての要素を破棄する
466-
- 2. 全てのバケットを順に走査して各バケットを初期化
467-
+ 1. 全ての要素を走査して各要素を破棄
468-
+ 2. 全てのバケットを走査して各バケットを初期化
469-
470-
という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。
471-
規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。
472-
&lt;/code&gt;&lt;/pre&gt;</summary>
473-
474-
<author>
475-
<name>koki watanabe</name>
476-
<email>address8128@gmail.com</email>
477-
</author>
478-
</entry>
479-
480-
<entry>
481-
<title>clear -- fix: minor fix</title>
482-
<link href="https://cpprefjp.github.io/reference/unordered_set/unordered_set/clear.html"/>
483-
<id>202823f1b3367e7eb4a9a9f7be0bbd14b493ad3a:reference/unordered_set/unordered_set/clear.md</id>
484-
<updated>2025-05-26T23:30:15+09:00</updated>
485-
486-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md
487-
index 188ae2c6d..064325559 100644
488-
--- a/reference/unordered_set/unordered_set/clear.md
489-
+++ b/reference/unordered_set/unordered_set/clear.md
490-
@@ -38,8 +38,8 @@ void clear() noexcept;
491-
492-
### 計算量に関する備考
493-
- 多くの実装(GCC libstdc++, LLVM libc++ など)は
494-
- 1. 全ての要素を破棄する
495-
- 2. 全てのバケットを順に走査して各バケットを初期化
496-
+ 1. 全ての要素を走査して各要素を破棄
497-
+ 2. 全てのバケットを走査して各バケットを初期化
498-
499-
という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。
500-
規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。
501-
&lt;/code&gt;&lt;/pre&gt;</summary>
502-
503-
<author>
504-
<name>koki watanabe</name>
505-
<email>address8128@gmail.com</email>
506-
</author>
507-
</entry>
508-
509434
</feed>

gen/pull/1450/sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7346,7 +7346,7 @@
73467346

73477347
<url>
73487348
<loc>https://cpprefjp.github.io/reference/unordered_map/unordered_map/clear.html</loc>
7349-
<lastmod>2025-05-28T22:54:36+09:00</lastmod>
7349+
<lastmod>2025-05-30T01:50:47+09:00</lastmod>
73507350
<changefreq>daily</changefreq>
73517351
<priority>0.6</priority>
73527352
</url>

0 commit comments

Comments
 (0)