Repository navigation
Expand file tree
/
Copy pathrss.xml
More file actions
273 lines (238 loc) · 12 KB
/
Copy pathrss.xml
File metadata and controls
273 lines (238 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>cpprefjp - C++日本語リファレンス</title>
<link href="https://cpprefjp.github.io" />
<updated>2026-11-16T23:29:11.416879</updated>
<id>34469031-191f-4da2-86ae-56043e73ba27</id>
<entry>
<title>invoke_default_contract_violation_handler -- fixing invoke_default_contract_violation_handler wrong note</title>
<link href="https://cpprefjp.github.io/reference/contracts/invoke_default_contract_violation_handler.html"/>
<id>4a2090b1e7fef80a0cec41c1730ffc8b63d29b1c:reference/contracts/invoke_default_contract_violation_handler.md</id>
<updated>2026-11-15T18:06:14+09:00</updated>
<summary type="html"><pre><code>diff --git a/reference/contracts/invoke_default_contract_violation_handler.md b/reference/contracts/invoke_default_contract_violation_handler.md
index 813c885da..bc488dee5 100644
--- a/reference/contracts/invoke_default_contract_violation_handler.md
+++ b/reference/contracts/invoke_default_contract_violation_handler.md
@@ -11,12 +11,16 @@ namespace std::contracts {
```
## 概要
-契約違反が発生した際に呼び出されるデフォルトのハンドラー関数。
+デフォルトの契約違反ハンドラを呼び出す。
-この関数は、契約違反が発生した際に、[`contract_violation`](contract_violation.md)オブジェクトを受け取り、デフォルトの処理を実行する。
+ユーザーが定義した契約違反ハンドラ`::handle_contract_violation`の中から、[`contract_violation`](contract_violation.md)オブジェクトを渡してデフォルトの処理を実行させるために使用できる。
## 効果
-契約違反の情報を標準エラー出力に出力し、[`std::terminate()`](/reference/exception/terminate.md)を呼び出す。
+デフォルトの契約違反ハンドラを引数`violation`で呼び出す。
+
+## 備考
+- デフォルトの契約違反ハンドラは処理系によって提供され、その具体的な動作は処理系に委ねられている
+- デフォルトの契約違反ハンドラは、[`contract_violation`](contract_violation.md)オブジェクトの内容を適切に整形した診断メッセージを出力し、その後正常にリターンすることが推奨されている
## バージョン
### 言語
</code></pre></summary>
<author>
<name>rotarymars</name>
<email>s.goto2050@gmail.com</email>
</author>
</entry>
<entry>
<title>local_time -- fixing local_time wrong sample</title>
<link href="https://cpprefjp.github.io/reference/chrono/local_time.html"/>
<id>ec207f2dc88c6d7d60e1f60b4f14fe29da5fa776:reference/chrono/local_time.md</id>
<updated>2026-11-15T17:50:16+09:00</updated>
<summary type="html"><pre><code>diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md
index 94d461148..15e67d108 100644
--- a/reference/chrono/local_time.md
+++ b/reference/chrono/local_time.md
@@ -92,7 +92,8 @@ using namespace std::chrono_literals;
int main()
{
// local_timeは、システム時間のエポックからの経過時間によって構築できる
- chrono::local_time&lt;chrono::system_clock::duration&gt; now {chrono::system_clock::now().time_since_epoch()};
+ chrono::system_clock::time_point sys_now = chrono::system_clock::now();
+ chrono::local_time&lt;chrono::system_clock::duration&gt; now {sys_now.time_since_epoch()};
// 秒単位の時間点 (日付と時間が出力される)
chrono::local_seconds sec_tp = chrono::floor&lt;chrono::seconds&gt;(now);
@@ -103,10 +104,11 @@ int main()
std::cout &lt;&lt; day_tp &lt;&lt; std::endl;
// 以下は、日本のタイムゾーンで日時を出力する方法:
+ // (zoned_timeにlocal_timeを渡すとタイムゾーンの変換は行われないため、システム時間を渡す)
// 1. コンピュータに設定されたタイムゾーンとして日時を出力
- std::cout &lt;&lt; chrono::zoned_time{chrono::current_zone(), now} &lt;&lt; std::endl;
+ std::cout &lt;&lt; chrono::zoned_time{chrono::current_zone(), sys_now} &lt;&lt; std::endl;
// 2. 日本のタイムゾーンとして日時を出力
- std::cout &lt;&lt; chrono::zoned_time{&#34;Asia/Tokyo&#34;, now} &lt;&lt; std::endl;
+ std::cout &lt;&lt; chrono::zoned_time{&#34;Asia/Tokyo&#34;, sys_now} &lt;&lt; std::endl;
// year_month_dayオブジェクトからローカル時間を構築
chrono::local_days ld{2020y/3/1};
</code></pre></summary>
<author>
<name>rotarymars</name>
<email>s.goto2050@gmail.com</email>
</author>
</entry>
<entry>
<title>to_chars -- fixing to_chars wrong note</title>
<link href="https://cpprefjp.github.io/reference/charconv/to_chars.html"/>
<id>4f9db27edeb432628d458e8752692716ffaeb922:reference/charconv/to_chars.md</id>
<updated>2026-11-15T17:42:12+09:00</updated>
<summary type="html"><pre><code>diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md
index bc835ebe1..482507678 100644
--- a/reference/charconv/to_chars.md
+++ b/reference/charconv/to_chars.md
@@ -143,7 +143,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない
- (6), (7), (8), (9) : `fmt`によって指定されたフォーマット指定子を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。
出力文字列が最も短くなるように変換される。
- `chars_format::general`が指定された場合は(2), (3), (4), (5)と同等。
+ `chars_format::general`が指定された場合は`%g`を用いる((2), (3), (4), (5)の`%f`/`%e`の選択とは異なる結果となる場合がある)。
- (10), (11), (12), (13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。
精度は、`chars_format::fixed`では小数点以下の正確な桁数、`chars_format::scientific`と`chars_format::hex`では最小の桁数を表す。
</code></pre></summary>
<author>
<name>rotarymars</name>
<email>s.goto2050@gmail.com</email>
</author>
</entry>
<entry>
<title>replace_copy_if -- fixing replace_copy_if wrong sample</title>
<link href="https://cpprefjp.github.io/reference/algorithm/replace_copy_if.html"/>
<id>daa885a5f6a01debc4ae236e996d1988435d1a9c:reference/algorithm/replace_copy_if.md</id>
<updated>2026-11-15T17:29:24+09:00</updated>
<summary type="html"><pre><code>diff --git a/reference/algorithm/replace_copy_if.md b/reference/algorithm/replace_copy_if.md
index 392293bf9..2599e9517 100644
--- a/reference/algorithm/replace_copy_if.md
+++ b/reference/algorithm/replace_copy_if.md
@@ -125,7 +125,6 @@ int main() {
#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;vector&gt;
-#include &lt;iterator&gt;
struct Point {
int x;
@@ -146,14 +145,19 @@ int main() {
{1, 2},
};
- // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する
+ // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものをresultにコピーする
+ std::vector&lt;Point&gt; result(v.size());
std::replace_copy_if(
v.begin(),
v.end(),
- std::ostream_iterator&lt;Point&gt;(std::cout, &#34;\n&#34;),
+ result.begin(),
[](const Point&amp; p) { return p.x == 1 &amp;&amp; p.y == 2; },
{9, 9}
);
+
+ for (const Point&amp; p : result) {
+ std::cout &lt;&lt; p &lt;&lt; std::endl;
+ }
}
```
* std::replace_copy_if[color ff0000]
</code></pre></summary>
<author>
<name>rotarymars</name>
<email>s.goto2050@gmail.com</email>
</author>
</entry>
<entry>
<title>move_backward -- fixing wrong overload</title>
<link href="https://cpprefjp.github.io/reference/algorithm/ranges_move_backward.html"/>
<id>ca9366bb1d08bf88defb0af4d68827028cd39d9f:reference/algorithm/ranges_move_backward.md</id>
<updated>2026-11-15T14:31:38+09:00</updated>
<summary type="html"><pre><code>diff --git a/reference/algorithm/ranges_move_backward.md b/reference/algorithm/ranges_move_backward.md
index 8217661a9..61c473d5c 100644
--- a/reference/algorithm/ranges_move_backward.md
+++ b/reference/algorithm/ranges_move_backward.md
@@ -21,43 +21,17 @@ namespace std::ranges {
constexpr move_backward_result&lt;borrowed_iterator_t&lt;R&gt;, I&gt;
move_backward(R&amp;&amp; r,
I result); // (2) C++20
-
- template &lt;execution-policy Ep,
- random_access_iterator I1,
- sized_sentinel_for&lt;I1&gt; S1,
- random_access_iterator I2&gt;
- requires indirectly_movable&lt;I1, I2&gt;
- move_backward_result&lt;I1, I2&gt;
- move_backward(Ep&amp;&amp; exec,
- I1 first,
- S1 last,
- I2 result); // (3) C++26
-
- template &lt;execution-policy Ep,
- sized-random-access-range R,
- random_access_iterator I&gt;
- requires indirectly_movable&lt;iterator_t&lt;R&gt;, I&gt;
- move_backward_result&lt;borrowed_iterator_t&lt;R&gt;, I&gt;
- move_backward(Ep&amp;&amp; exec,
- R&amp;&amp; r,
- I result); // (4) C++26
}
```
* move_backward_result[link ranges_in_out_result.md]
* indirectly_movable[link /reference/iterator/indirectly_movable.md]
* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md]
-* execution-policy[link /reference/execution/execution-policy.md]
-* random_access_iterator[link /reference/iterator/random_access_iterator.md]
-* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md]
-* sized-random-access-range[link /reference/ranges/sized-random-access-range.md]
## 概要
指定された範囲の要素を後ろからムーブする。
- (1): イテレータ範囲を指定する
- (2): Rangeを直接指定する
-- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する
-- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する
## 事前条件
`result` は `(first,last]` の範囲に含まれてはならない。
@@ -87,7 +61,6 @@ move_backward_result {
## 例
-### 基本的な使い方
```cpp example
#include &lt;algorithm&gt;
#include &lt;iostream&gt;
@@ -131,33 +104,6 @@ int main() {
2
```
-### 並列アルゴリズムの例 (C++26)
-```cpp example
-#include &lt;algorithm&gt;
-#include &lt;execution&gt;
-#include &lt;iostream&gt;
-#include &lt;vector&gt;
-
-int main() {
- std::vector&lt;int&gt; v = {1, 2, 3, 0, 0};
-
- // 並列に先頭3要素を後方へムーブ
- std::ranges::move_backward(std::execution::par,
- v.begin(), v.begin() + 3, v.end());
-
- for (int x : v) {
- std::cout &lt;&lt; x &lt;&lt; &#39; &#39;;
- }
- std::cout &lt;&lt; std::endl;
-}
-```
-* std::ranges::move_backward[color ff0000]
-
-#### 出力
-```
-1 2 1 2 3
-```
-
## バージョン
### 言語
- C++20
@@ -169,4 +115,3 @@ int main() {
## 参照
- [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms)
-- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html)
</code></pre></summary>
<author>
<name>rotarymars</name>
<email>s.goto2050@gmail.com</email>
</author>
</entry>
</feed>