Skip to content

Commit 39882b2

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 1513eb6 commit 39882b2

4 files changed

Lines changed: 34 additions & 190 deletions

File tree

reference/atomic/atomic_store_or.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@
189189
<p class="text-right"><small>
190190
最終更新日時:
191191
<time itemprop="datePublished" class="js-local-time"
192-
datetime="2025-10-10T13:00:13+09:00">
193-
2025年10月10日 13時00分13秒 (JST)
192+
datetime="2026-09-16T10:54:02+09:00">
193+
2026年09月16日 10時54分02秒 (JST)
194194
</time>
195195
<br/>
196196
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -297,7 +297,7 @@ <h2>例</h2>
297297
</code></pre></div>
298298
</div></p>
299299
<h3>出力</h3>
300-
<p><pre><code>0b0101
300+
<p><pre><code>0b1101
301301
</code></pre></p>
302302
<h2>バージョン</h2>
303303
<h3>言語</h3>

reference/chrono/make24.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ <h2>例</h2>
263263
<span class="w"> </span><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="w"> </span><span class="nb">false</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n"><a href="duration/op_h.html">0h</a></span><span class="p">);</span>
264264

265265
<span class="w"> </span><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="w"> </span><span class="nb">true</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">);</span>
266-
<span class="w"> </span><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="w"> </span><span class="nb">true</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1U</span><span class="n">kmKKtmDOLBWvKvLQJkODVgVIZEbNgbU</span><span class="p">);</span>
266+
<span class="w"> </span><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="w"> </span><span class="nb">true</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="n"><a href="duration/op_h.html">3h</a></span><span class="p">);</span>
267267
<span class="w"> </span><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="w"> </span><span class="nb">true</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n"><a href="duration/op_h.html">15h</a></span><span class="p">);</span>
268268
<span class="w"> </span><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="w"> </span><span class="nb">true</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n"><a href="duration/op_h.html">23h</a></span><span class="p">);</span>
269269
<span class="p">}</span>

rss.xml

Lines changed: 29 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,37 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2026-09-15T18:24:12.152847</updated>
6-
<id>50576c6c-b19d-4d32-b099-b0cd19b81dec</id>
5+
<updated>2026-09-16T01:56:08.415564</updated>
6+
<id>296840ba-a07a-4f57-a37e-212c3c4d2ac0</id>
77

88

9+
<entry>
10+
<title>atomic_store_or -- atomic_store_or : 出力の間違いを修正</title>
11+
<link href="https://cpprefjp.github.io/reference/atomic/atomic_store_or.html"/>
12+
<id>b9fc76bb279738bd15e3e1bce573f6659fe2717d:reference/atomic/atomic_store_or.md</id>
13+
<updated>2026-09-16T10:54:02+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/atomic/atomic_store_or.md b/reference/atomic/atomic_store_or.md
16+
index 44de359f8..15d164703 100644
17+
--- a/reference/atomic/atomic_store_or.md
18+
+++ b/reference/atomic/atomic_store_or.md
19+
@@ -76,7 +76,7 @@ int main()
20+
21+
### 出力
22+
```
23+
-0b0101
24+
+0b1101
25+
```
26+
27+
28+
&lt;/code&gt;&lt;/pre&gt;</summary>
29+
30+
<author>
31+
<name>Akira Takahashi</name>
32+
<email>faithandbrave@gmail.com</email>
33+
</author>
34+
</entry>
35+
936
<entry>
1037
<title>コンストラクタ -- fix in ambiguous convertion</title>
1138
<link href="https://cpprefjp.github.io/reference/chrono/zoned_time/op_constructor.html"/>
@@ -454,189 +481,6 @@ index d18207ac8..b5a3ae3cc 100644
454481

455482
```cpp example
456483
#include &amp;lt;type_traits&amp;gt;
457-
&lt;/code&gt;&lt;/pre&gt;</summary>
458-
459-
<author>
460-
<name>Akira Takahashi</name>
461-
<email>faithandbrave@gmail.com</email>
462-
</author>
463-
</entry>
464-
465-
<entry>
466-
<title>constexpr if 文 [P0292R2] -- Merge pull request #1260 from cpprefjp/refactor/cwg2518</title>
467-
<link href="https://cpprefjp.github.io/lang/cpp17/if_constexpr.html"/>
468-
<id>437e7550bfa7198efb270a555edb0cf7f3c4b12e:lang/cpp17/if_constexpr.md</id>
469-
<updated>2026-09-15T16:05:27+09:00</updated>
470-
471-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md
472-
index e67a44ecd..d18207ac8 100644
473-
--- a/lang/cpp17/if_constexpr.md
474-
+++ b/lang/cpp17/if_constexpr.md
475-
@@ -76,57 +76,57 @@ void f(Out&amp;amp; o, A1 const&amp;amp; a1, A2 const&amp;amp; a2)
476-
それでも記述が実際にしたい処理に比べて不必要に複雑になる。
477-
constexpr if文の導入によりそのような複雑な手法を用いずに素直に条件付きのコンパイルを実現できるようになった。
478-
479-
-### 2段階名前探索における注意点
480-
-
481-
-`constexpr if`文で、実行されない方の`statement`は廃棄文(discarded statement)となり、文の実体化を防ぐ。言い換えると、2段階名前探索における依存名(dependent name)は、廃棄文の場合検証されない。また文が実体化されないのだから通常のif文と同じくもちろん実行時に実行もされない。つまり次の例は意図と異なる挙動を示す。
482-
+`constexpr if`文の条件式内は実体化が起きる。したがって実体化するとコンパイルエラーになるものは書いてはいけない。
483-
484-
```cpp example
485-
#include &amp;lt;type_traits&amp;gt;
486-
+#include &amp;lt;iostream&amp;gt;
487-
+
488-
+struct Hoge {
489-
+ using type = int;
490-
+};
491-
492-
template &amp;lt;typename T&amp;gt;
493-
-void f(T)
494-
+void f()
495-
{
496-
- if constexpr (std::is_same_v&amp;lt;T, int&amp;gt;)
497-
- {
498-
- // Tがintのときのみ評価されてほしい
499-
- // 実際は常に評価される
500-
- static_assert(false);
501-
+ if constexpr (std::is_same_v&amp;lt;typename T::type, int&amp;gt; || std::is_same_v&amp;lt;typename T::value_type, int&amp;gt;) {
502-
+ std::cout &amp;lt;&amp;lt; &amp;#34;is int&amp;#34; &amp;lt;&amp;lt; std::endl;
503-
}
504-
}
505-
506-
int main()
507-
{
508-
- f(2.4);
509-
- f(3);
510-
+ f&amp;lt;Hoge&amp;gt;(); //error: Hoge::value_typeは存在しないのでif constexpr文の条件式がコンパイルエラーになる
511-
}
512-
```
513-
514-
-なぜならば廃棄文はテンプレートの実体化を防ぐ (依存名の検証をしない) だけで、非依存名は検証されるからである。この例の[`static_assert`](/lang/cpp11/static_assert.md)に渡す条件式はテンプレートパラメータに依存していないので、テンプレートの宣言時に検証され、エラーとなる。言い換えれば`static_assert`に渡す条件式が依存名ならばテンプレートの宣言時に検証されず、テンプレート実体化まで評価を遅らせることができる。
515-
-
516-
-```cpp example
517-
-#include &amp;lt;type_traits&amp;gt;
518-
+### `static_assert`宣言に関する例外
519-
520-
-template &amp;lt;typename T&amp;gt;
521-
-constexpr bool false_v = false;
522-
+後に述べる2段階名前探索に関する注意点とは関係なく、C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際に実体化されない限り、`static_assert`宣言による失敗は無視される。
523-
524-
-template &amp;lt;typename T&amp;gt;
525-
-void f(T)
526-
-{
527-
- if constexpr (std::is_same_v&amp;lt;T, int&amp;gt;)
528-
- {
529-
- // Tがintのときのみ評価される
530-
- static_assert(false_v&amp;lt;T&amp;gt;);
531-
+```cpp example
532-
+#include &amp;lt;cstdint&amp;gt;
533-
+template &amp;lt;class T&amp;gt;
534-
+void f(T t) {
535-
+ if constexpr (sizeof(T) == sizeof(std::int32_t)) {
536-
+ use(t);
537-
+ } else {
538-
+ static_assert(false, &amp;#34;must be 32bit&amp;#34;);
539-
}
540-
}
541-
542-
-int main()
543-
-{
544-
- f(2.4);
545-
- f(3);
546-
+void g(std::int8_t c) {
547-
+ std::int32_t n = 0;
548-
+ f(n); // OK: nはstd::int32_t型なので`use(t);`のほうが実体化されるために、static_assert宣言の失敗は無視される。
549-
+ f(c); // error: cはstd::int8_t型なので、static_assert宣言は失敗し、&amp;#34;must be 32bit&amp;#34;とコンパイラが診断メッセージを出力する
550-
}
551-
```
552-
553-
-上の例では`false_v`を作ったが、ラムダ式でも同様のことができる。ラムダ式はそれが記述された位置から見て最小のスコープ (ブロックスコープ/クラススコープ/名前空間スコープ) で宣言されるクラスとして扱われる。例えば、下の例では`f()`という関数テンプレート内で宣言される。関数テンプレート内のクラスは依存名になるため、テンプレートの宣言時に検証されず、テンプレート実体化まで評価を遅らせることができる。
554-
+### 2段階名前探索における注意点
555-
+
556-
+`constexpr if`文で、実行されない方の`statement`は廃棄文(discarded statement)となり、文の実体化を防ぐ。言い換えると、2段階名前探索における依存名(dependent name)は、廃棄文の場合検証されない。また文が実体化されないのだから通常のif文と同じくもちろん実行時に実行もされない。
557-
+
558-
+CWG 2518が適用されていない環境においては`static_assert`を用いる時に直感的ではない挙動を示していた。
559-
560-
```cpp example
561-
#include &amp;lt;type_traits&amp;gt;
562-
@@ -136,8 +136,9 @@ void f(T)
563-
{
564-
if constexpr (std::is_same_v&amp;lt;T, int&amp;gt;)
565-
{
566-
- // Tがintのときのみ評価される
567-
- static_assert([]{return false;}());
568-
+ // Tがintのときのみ評価されてほしい
569-
+ // 実際は常に評価される
570-
+ static_assert(false);
571-
}
572-
}
573-
574-
@@ -148,51 +149,32 @@ int main()
575-
}
576-
```
577-
578-
-`constexpr if`文の条件式内は実体化が起きる。したがって実体化するとコンパイルエラーになるものは書いてはいけない。
579-
+なぜならば廃棄文はテンプレートの実体化を防ぐ (依存名の検証をしない) だけで、非依存名は検証されるからである。この例の[`static_assert`](/lang/cpp11/static_assert.md)に渡す条件式はテンプレートパラメータに依存していないので、テンプレートの宣言時に検証され、エラーとなる。
580-
+
581-
+#### CWG 2518が適用されていない環境での回避策
582-
+
583-
+言い換えれば`static_assert`に渡す条件式が依存名ならばテンプレートの宣言時に検証されず、テンプレート実体化まで評価を遅らせることができる。
584-
585-
```cpp example
586-
#include &amp;lt;type_traits&amp;gt;
587-
-#include &amp;lt;iostream&amp;gt;
588-
589-
-struct Hoge {
590-
- using type = int;
591-
-};
592-
+template &amp;lt;typename T&amp;gt;
593-
+constexpr bool false_v = false;
594-
595-
template &amp;lt;typename T&amp;gt;
596-
-void f()
597-
+void f(T)
598-
{
599-
- if constexpr (std::is_same_v&amp;lt;typename T::type, int&amp;gt; || std::is_same_v&amp;lt;typename T::value_type, int&amp;gt;) {
600-
- std::cout &amp;lt;&amp;lt; &amp;#34;is int&amp;#34; &amp;lt;&amp;lt; std::endl;
601-
+ if constexpr (std::is_same_v&amp;lt;T, int&amp;gt;)
602-
+ {
603-
+ // Tがintのときのみ評価される
604-
+ static_assert(false_v&amp;lt;T&amp;gt;);
605-
}
606-
}
607-
608-
int main()
609-
{
610-
- f&amp;lt;Hoge&amp;gt;(); //error: Hoge::value_typeは存在しないのでif constexpr文の条件式がコンパイルエラーになる
611-
-}
612-
-```
613-
-
614-
-### (CWG 2518が適用された環境) `static_assert`文に関する例外
615-
-
616-
-上に述べたように、`constexpr if`文の中の文は廃棄文においても、非依存名の検証を行う。このため特に`static_assert`文を使う時に直感的ではない挙動を示していた。
617-
-
618-
-C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。
619-
-
620-
-```cpp example
621-
-#include &amp;lt;cstdint&amp;gt;
622-
-template &amp;lt;class T&amp;gt;
623-
-void f(T t) {
624-
- if constexpr (sizeof(T) == sizeof(std::int32_t)) {
625-
- use(t);
626-
- } else {
627-
- static_assert(false, &amp;#34;must be 32bit&amp;#34;);
628-
- }
629-
-}
630-
-
631-
-void g(std::int8_t c) {
632-
- std::int32_t n = 0;
633-
- f(n); // OK: nはstd::int32_t型なので`use(t);`のほうがインスタンス化されるために、static_assert文は宣言されない。
634-
- f(c); // error: cはstd::int8_t型なので、static_assert文は宣言され、&amp;#34;must be 32bit&amp;#34;とコンパイラが診断メッセージを出力する
635-
+ f(2.4);
636-
+ f(3);
637-
}
638-
```
639-
640484
&lt;/code&gt;&lt;/pre&gt;</summary>
641485

642486
<author>

sitemap.xml

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

1385713857
<url>
1385813858
<loc>https://cpprefjp.github.io/reference/atomic/atomic_store_or.html</loc>
13859-
<lastmod>2026-09-15T16:05:27+09:00</lastmod>
13859+
<lastmod>2026-09-16T10:54:02+09:00</lastmod>
1386013860
<changefreq>daily</changefreq>
1386113861
<priority>0.7</priority>
1386213862
</url>

0 commit comments

Comments
 (0)