|
2 | 2 | <feed xmlns="http://www.w3.org/2005/Atom"> |
3 | 3 | <title>cpprefjp - C++日本語リファレンス</title> |
4 | 4 | <link href="https://cpprefjp.github.io" /> |
5 | | - <updated>2025-11-18T06:45:01.790010</updated> |
6 | | - <id>9be9a6b2-0833-46b5-b0eb-4582c3ad1abc</id> |
| 5 | + <updated>2025-11-18T06:56:01.955067</updated> |
| 6 | + <id>9579f137-e9fc-4c08-bd71-7295247ccfbe</id> |
7 | 7 |
|
8 | 8 |
|
| 9 | + <entry> |
| 10 | + <title>コンストラクタ -- stop_sourceのコンストラクタ : さらにコード修飾を追加</title> |
| 11 | + <link href="https://cpprefjp.github.io/reference/stop_token/stop_source/op_constructor.html"/> |
| 12 | + <id>69e0ab8414039815eade662cee420c947f654ab9:reference/stop_token/stop_source/op_constructor.md</id> |
| 13 | + <updated>2025-11-18T15:51:48+09:00</updated> |
| 14 | + |
| 15 | + <summary type="html"><pre><code>diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md |
| 16 | +index d0286e3f1..4ec0e0a4a 100644 |
| 17 | +--- a/reference/stop_token/stop_source/op_constructor.md |
| 18 | ++++ b/reference/stop_token/stop_source/op_constructor.md |
| 19 | +@@ -57,6 +57,7 @@ int main() |
| 20 | + * std::move[link /reference/utility/move.md] |
| 21 | + * std::stop_source[link ../stop_source.md] |
| 22 | + * std::nostopstate[link ../nostopstate.md] |
| 23 | ++* stop_possible()[link stop_possible.md] |
| 24 | + * stop_requested()[link stop_requested.md] |
| 25 | + * request_stop()[link request_stop.md] |
| 26 | + |
| 27 | +</code></pre></summary> |
| 28 | + |
| 29 | + <author> |
| 30 | + <name>Akira Takahashi</name> |
| 31 | + |
| 32 | + </author> |
| 33 | + </entry> |
| 34 | + |
9 | 35 | <entry> |
10 | 36 | <title>コンストラクタ -- stop_sourceのコンストラクタ : コード修飾を追加</title> |
11 | 37 | <link href="https://cpprefjp.github.io/reference/stop_token/stop_source/op_constructor.html"/> |
@@ -1107,294 +1133,6 @@ index 000000000..3476e9e9a |
1107 | 1133 | + |
1108 | 1134 | +## 参照 |
1109 | 1135 | +- [P3168R2 Give std::optional Range Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3168r2.html) |
1110 | | -</code></pre></summary> |
1111 | | - |
1112 | | - <author> |
1113 | | - <name>suomesta</name> |
1114 | | - |
1115 | | - </author> |
1116 | | - </entry> |
1117 | | - |
1118 | | - <entry> |
1119 | | - <title>basic_string -- add basic_string::subview() and basic_string_view::subview(). (#1503)</title> |
1120 | | - <link href="https://cpprefjp.github.io/reference/string/basic_string.html"/> |
1121 | | - <id>b403dd0898f3d135bd1fae41157a9aee45ebe9b3:reference/string/basic_string.md</id> |
1122 | | - <updated>2025-11-10T22:21:07+09:00</updated> |
1123 | | - |
1124 | | - <summary type="html"><pre><code>diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md |
1125 | | -index ba8e94fcc..c4682fac5 100644 |
1126 | | ---- a/reference/string/basic_string.md |
1127 | | -+++ b/reference/string/basic_string.md |
1128 | | -@@ -145,6 +145,7 @@ namespace std { |
1129 | | - | [`find_first_not_of`](basic_string/find_first_not_of.md) | 先頭から、指定文字が見つからない位置を検索する | | |
1130 | | - | [`find_last_not_of`](basic_string/find_last_not_of.md) | 末尾から、指定文字が見つからない位置を検索する | | |
1131 | | - | [`substr`](basic_string/substr.md) | 部分文字列を取得する | | |
1132 | | -+| [`subview`](basic_string/subview.md) | 部分文字列の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を構築する | C++26 | |
1133 | | - | [`compare`](basic_string/compare.md) | 他の文字列との比較を行う | | |
1134 | | - | [`starts_with`](basic_string/starts_with.md) | 指定の文字列で始まるかを判定する | C++20 | |
1135 | | - | [`ends_with`](basic_string/ends_with.md) | 指定の文字列で終わるかを判定する | C++20 | |
1136 | | -</code></pre></summary> |
1137 | | - |
1138 | | - <author> |
1139 | | - <name>suomesta</name> |
1140 | | - |
1141 | | - </author> |
1142 | | - </entry> |
1143 | | - |
1144 | | - <entry> |
1145 | | - <title>subview -- add basic_string::subview() and basic_string_view::subview(). (#1503)</title> |
1146 | | - <link href="https://cpprefjp.github.io/reference/string/basic_string/subview.html"/> |
1147 | | - <id>b403dd0898f3d135bd1fae41157a9aee45ebe9b3:reference/string/basic_string/subview.md</id> |
1148 | | - <updated>2025-11-10T22:21:07+09:00</updated> |
1149 | | - |
1150 | | - <summary type="html"><pre><code>diff --git a/reference/string/basic_string/subview.md b/reference/string/basic_string/subview.md |
1151 | | -new file mode 100644 |
1152 | | -index 000000000..364409e34 |
1153 | | ---- /dev/null |
1154 | | -+++ b/reference/string/basic_string/subview.md |
1155 | | -@@ -0,0 +1,90 @@ |
1156 | | -+# subview |
1157 | | -+* string[meta header] |
1158 | | -+* std[meta namespace] |
1159 | | -+* basic_string[meta class] |
1160 | | -+* function[meta id-type] |
1161 | | -+* cpp26[meta cpp] |
1162 | | -+ |
1163 | | -+```cpp |
1164 | | -+constexpr basic_string_view&lt;charT, traits&gt; |
1165 | | -+ subview(size_type pos = 0, |
1166 | | -+ size_type n = npos) const; |
1167 | | -+``` |
1168 | | -+ |
1169 | | -+## 概要 |
1170 | | -+部分文字列の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を構築する。 |
1171 | | -+`pos`番目から`n`要素の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を返す。 |
1172 | | -+引数省略時は、先頭位置(`0`番目)から全要素(`npos`)の文字列を返す。 |
1173 | | -+ |
1174 | | -+ |
1175 | | -+## 要件 |
1176 | | -+`pos &lt;=` [`size()`](size.md) |
1177 | | -+ |
1178 | | -+ |
1179 | | -+## 効果 |
1180 | | -+次と等価 : `return` [`basic_string_view`](/reference/string_view/basic_string_view.md)`&lt;charT, traits&gt;(*this).`[`subview`](/reference/string_view/basic_string_view/subview.md)`(pos, n)`。 |
1181 | | -+ |
1182 | | -+ |
1183 | | -+## 注意 |
1184 | | -+本関数は使い方を誤ると、ぶら下がり参照が発生し得る。 |
1185 | | -+```cpp example |
1186 | | -+#include &lt;print&gt; |
1187 | | -+#include &lt;string&gt; |
1188 | | -+#include &lt;string_view&gt; |
1189 | | -+ |
1190 | | -+int main() { |
1191 | | -+ // OK |
1192 | | -+ std::string s(3, &#39;A&#39;); |
1193 | | -+ std::string_view sv = s.subview(); |
1194 | | -+ std::println(&#34;{}&#34;, sv); |
1195 | | -+ |
1196 | | -+ // OK |
1197 | | -+ std::println(&#34;{}&#34;, std::string(3, &#39;A&#39;).subview()); |
1198 | | -+ |
1199 | | -+ // NG! |
1200 | | -+ std::string_view d = std::string(3, &#39;A&#39;).subview(); // ぶら下がり参照発生 |
1201 | | -+ std::println(&#34;{}&#34;, d); // 不定動作 |
1202 | | -+} |
1203 | | -+``` |
1204 | | -+ |
1205 | | -+ |
1206 | | -+## 例 |
1207 | | -+```cpp example |
1208 | | -+#include &lt;iostream&gt; |
1209 | | -+#include &lt;string&gt; |
1210 | | -+#include &lt;string_view&gt; |
1211 | | -+ |
1212 | | -+int main() { |
1213 | | -+ std::string s = &#34;Hello world!&#34;; |
1214 | | -+ |
1215 | | -+ std::string_view sv = s.subview(6, 5); |
1216 | | -+ |
1217 | | -+ std::cout &lt;&lt; sv; |
1218 | | -+} |
1219 | | -+``` |
1220 | | -+* subview[color ff0000] |
1221 | | -+ |
1222 | | -+### 出力 |
1223 | | -+``` |
1224 | | -+world |
1225 | | -+``` |
1226 | | -+ |
1227 | | -+ |
1228 | | -+## バージョン |
1229 | | -+### 言語 |
1230 | | -+- C++26 |
1231 | | -+ |
1232 | | -+### 処理系 |
1233 | | -+- [Clang](/implementation.md#clang): ?? |
1234 | | -+- [GCC](/implementation.md#gcc): ?? |
1235 | | -+- [ICC](/implementation.md#icc): ?? |
1236 | | -+- [Visual C++](/implementation.md#visual_cpp): ?? |
1237 | | -+ |
1238 | | -+ |
1239 | | -+## 参照 |
1240 | | -+ |
1241 | | -+- [P3044R2 sub-string_view from string](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3044r2.pdf) |
1242 | | -+ |
1243 | | -+ |
1244 | | -+## 関連項目 |
1245 | | -+- [`basic_string_view::subview`](/reference/string_view/basic_string_view/subview.md) |
1246 | | -</code></pre></summary> |
1247 | | - |
1248 | | - <author> |
1249 | | - <name>suomesta</name> |
1250 | | - |
1251 | | - </author> |
1252 | | - </entry> |
1253 | | - |
1254 | | - <entry> |
1255 | | - <title>basic_string_view -- add basic_string::subview() and basic_string_view::subview(). (#1503)</title> |
1256 | | - <link href="https://cpprefjp.github.io/reference/string_view/basic_string_view.html"/> |
1257 | | - <id>b403dd0898f3d135bd1fae41157a9aee45ebe9b3:reference/string_view/basic_string_view.md</id> |
1258 | | - <updated>2025-11-10T22:21:07+09:00</updated> |
1259 | | - |
1260 | | - <summary type="html"><pre><code>diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md |
1261 | | -index a3c916a8b..ada82c5ce 100644 |
1262 | | ---- a/reference/string_view/basic_string_view.md |
1263 | | -+++ b/reference/string_view/basic_string_view.md |
1264 | | -@@ -94,6 +94,7 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する |
1265 | | - |------|------|----------------| |
1266 | | - | [`copy`](basic_string_view/copy.md) | 他の文字列に、自身の文字列をコピーする | C++17 | |
1267 | | - | [`substr`](basic_string_view/substr.md) | 部分文字列を取得する | C++17 | |
1268 | | -+| [`subview`](basic_string_view/subview.md) | 部分文字列を取得する | C++26 | |
1269 | | - | [`compare`](basic_string_view/compare.md) | 他の文字列との比較を行う | C++17 | |
1270 | | - | [`starts_with`](basic_string_view/starts_with.md) | 指定の文字列で始まるかを判定する | C++20 | |
1271 | | - | [`ends_with`](basic_string_view/ends_with.md) | 指定の文字列で終わるかを判定する | C++20 | |
1272 | | -</code></pre></summary> |
1273 | | - |
1274 | | - <author> |
1275 | | - <name>suomesta</name> |
1276 | | - |
1277 | | - </author> |
1278 | | - </entry> |
1279 | | - |
1280 | | - <entry> |
1281 | | - <title>substr -- add basic_string::subview() and basic_string_view::subview(). (#1503)</title> |
1282 | | - <link href="https://cpprefjp.github.io/reference/string_view/basic_string_view/substr.html"/> |
1283 | | - <id>b403dd0898f3d135bd1fae41157a9aee45ebe9b3:reference/string_view/basic_string_view/substr.md</id> |
1284 | | - <updated>2025-11-10T22:21:07+09:00</updated> |
1285 | | - |
1286 | | - <summary type="html"><pre><code>diff --git a/reference/string_view/basic_string_view/substr.md b/reference/string_view/basic_string_view/substr.md |
1287 | | -index 2974a14df..db451e948 100644 |
1288 | | ---- a/reference/string_view/basic_string_view/substr.md |
1289 | | -+++ b/reference/string_view/basic_string_view/substr.md |
1290 | | -@@ -65,3 +65,7 @@ int main() |
1291 | | - - [GCC](/implementation.md#gcc): 7.1 [mark verified] |
1292 | | - - [ICC](/implementation.md#icc): ?? |
1293 | | - - [Visual C++](/implementation.md#visual_cpp): ?? |
1294 | | -+ |
1295 | | -+ |
1296 | | -+## 関連項目 |
1297 | | -+- [`subview`](subview.md) |
1298 | | -</code></pre></summary> |
1299 | | - |
1300 | | - <author> |
1301 | | - <name>suomesta</name> |
1302 | | - |
1303 | | - </author> |
1304 | | - </entry> |
1305 | | - |
1306 | | - <entry> |
1307 | | - <title>subview -- add basic_string::subview() and basic_string_view::subview(). (#1503)</title> |
1308 | | - <link href="https://cpprefjp.github.io/reference/string_view/basic_string_view/subview.html"/> |
1309 | | - <id>b403dd0898f3d135bd1fae41157a9aee45ebe9b3:reference/string_view/basic_string_view/subview.md</id> |
1310 | | - <updated>2025-11-10T22:21:07+09:00</updated> |
1311 | | - |
1312 | | - <summary type="html"><pre><code>diff --git a/reference/string_view/basic_string_view/subview.md b/reference/string_view/basic_string_view/subview.md |
1313 | | -new file mode 100644 |
1314 | | -index 000000000..6f098e061 |
1315 | | ---- /dev/null |
1316 | | -+++ b/reference/string_view/basic_string_view/subview.md |
1317 | | -@@ -0,0 +1,80 @@ |
1318 | | -+# subview |
1319 | | -+* string_view[meta header] |
1320 | | -+* std[meta namespace] |
1321 | | -+* basic_string_view[meta class] |
1322 | | -+* function[meta id-type] |
1323 | | -+* cpp26[meta cpp] |
1324 | | -+ |
1325 | | -+```cpp |
1326 | | -+constexpr basic_string_view&lt;charT, traits&gt; |
1327 | | -+ subview(size_type pos = 0, |
1328 | | -+ size_type n = npos) const; |
1329 | | -+``` |
1330 | | -+ |
1331 | | -+## 概要 |
1332 | | -+部分文字列を取得する。 |
1333 | | -+ |
1334 | | -+本関数は[`substr`](substr.md)と全く同じ動作である。[`std::string`](/reference/string/basic_string.md)とインターフェースを揃える目的で追加された。 |
1335 | | -+ |
1336 | | -+ |
1337 | | -+## 戻り値 |
1338 | | -+指定された位置`pos`から`n`文字からなる部分文字列を構築して返す。 |
1339 | | -+ |
1340 | | -+[`size()`](size.md) `- pos`と`n`うち、小さい方を`rlen`とし、`basic_string_view(`[`data()`](data.md) `+ pos, rlen)`を返す。 |
1341 | | -+ |
1342 | | -+ |
1343 | | -+## 例外 |
1344 | | -+`pos &gt;` [`size()`](size.md)の場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する。 |
1345 | | -+ |
1346 | | -+ |
1347 | | -+## 例 |
1348 | | -+```cpp example |
1349 | | -+#include &lt;iostream&gt; |
1350 | | -+#include &lt;string_view&gt; |
1351 | | -+ |
1352 | | -+int main() |
1353 | | -+{ |
1354 | | -+ std::string_view sv = &#34;This is a pen&#34;; |
1355 | | -+ |
1356 | | -+ std::string_view ret1 = sv.subview(5); // 5番目から最後までの文字列を取得 |
1357 | | -+ std::string_view ret2 = sv.subview(5, 2); // 5番目から2文字の文字列を取得 |
1358 | | -+ |
1359 | | -+ std::cout &lt;&lt; &#34;1 : [&#34; &lt;&lt; ret1 &lt;&lt; &#39;]&#39; &lt;&lt; std::endl; |
1360 | | -+ std::cout &lt;&lt; &#34;2 : [&#34; &lt;&lt; ret2 &lt;&lt; &#39;]&#39; &lt;&lt; std::endl; |
1361 | | -+ |
1362 | | -+ // subviewはデータを切り取るのではなく、参照位置と参照サイズを変更するだけなので、 |
1363 | | -+ // 生ポインタを介せば全体の文字列を復元することはできる。 |
1364 | | -+ const char* ret3 = ret1.data() - 5; |
1365 | | -+ std::cout &lt;&lt; &#34;3 : [&#34; &lt;&lt; ret3 &lt;&lt; &#39;]&#39; &lt;&lt; std::endl; |
1366 | | -+} |
1367 | | -+``` |
1368 | | -+* subview[color ff0000] |
1369 | | -+* ret1.data()[link data.md] |
1370 | | -+ |
1371 | | -+### 出力 |
1372 | | -+``` |
1373 | | -+1 : [is a pen] |
1374 | | -+2 : [is] |
1375 | | -+3 : [This is a pen] |
1376 | | -+``` |
1377 | | -+ |
1378 | | -+ |
1379 | | -+## バージョン |
1380 | | -+### 言語 |
1381 | | -+- C++26 |
1382 | | -+ |
1383 | | -+### 処理系 |
1384 | | -+- [Clang](/implementation.md#clang): ?? |
1385 | | -+- [GCC](/implementation.md#gcc): ?? |
1386 | | -+- [ICC](/implementation.md#icc): ?? |
1387 | | -+- [Visual C++](/implementation.md#visual_cpp): ?? |
1388 | | -+ |
1389 | | -+ |
1390 | | -+## 参照 |
1391 | | -+ |
1392 | | -+- [P3044R2 sub-string_view from string](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3044r2.pdf) |
1393 | | -+ |
1394 | | -+ |
1395 | | -+## 関連項目 |
1396 | | -+- [`substr`](substr.md) |
1397 | | -+- [`basic_string::subview`](/reference/string/basic_string/subview.md) |
1398 | 1136 | </code></pre></summary> |
1399 | 1137 |
|
1400 | 1138 | <author> |
|
0 commit comments