|
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>2026-09-03T01:59:01.455789</updated> |
6 | | - <id>bfeebc4f-d116-4757-8dc9-4d64c032090d</id> |
| 5 | + <updated>2026-09-03T02:11:58.587516</updated> |
| 6 | + <id>9c2c5121-dfb3-4641-9439-146561c80bfd</id> |
7 | 7 |
|
8 | 8 |
|
| 9 | + <entry> |
| 10 | + <title>auto(x)による一時オブジェクトへの変換 [P0849R8] -- C++23 auto_cast : コード修飾を追加</title> |
| 11 | + <link href="https://cpprefjp.github.io/lang/cpp23/auto_cast.html"/> |
| 12 | + <id>da36b281e6f4331201f20b5d7999b293e04db5a5:lang/cpp23/auto_cast.md</id> |
| 13 | + <updated>2026-09-03T11:09:53+09:00</updated> |
| 14 | + |
| 15 | + <summary type="html"><pre><code>diff --git a/lang/cpp23/auto_cast.md b/lang/cpp23/auto_cast.md |
| 16 | +index dcb88bbe8..a4a97c5ed 100644 |
| 17 | +--- a/lang/cpp23/auto_cast.md |
| 18 | ++++ b/lang/cpp23/auto_cast.md |
| 19 | +@@ -19,6 +19,7 @@ void f(std::vector&lt;int&gt;&amp; v) |
| 20 | + g(auto(v.front())); |
| 21 | + } |
| 22 | + ``` |
| 23 | ++* v.front[link /reference/vector/vector/front.md] |
| 24 | + |
| 25 | + コピーを作るだけであれば`auto a = v.front();`のように変数宣言でもよいが、この場合はコピーであることが宣言の副次的な性質にすぎず、得られる`a`も左辺値である。`auto(...)`は「値をコピーする」という操作を式として直接表現でき、その結果は関数へ値渡しした場合と同じprvalue (一時オブジェクト) となる。 |
| 26 | + |
| 27 | +@@ -110,6 +111,9 @@ int main() |
| 28 | + std::cout &lt;&lt; std::endl; |
| 29 | + } |
| 30 | + ``` |
| 31 | ++* v.front[link /reference/vector/vector/front.md] |
| 32 | ++* std::remove[link /reference/algorithm/remove.md] |
| 33 | ++* v.erase[link /reference/vector/vector/erase.md] |
| 34 | + |
| 35 | + ### 出力 |
| 36 | + ``` |
| 37 | +@@ -128,6 +132,7 @@ constexpr std::decay_t&lt;T&gt; decay_copy(T&amp;&amp; v) |
| 38 | + return std::forward&lt;T&gt;(v); |
| 39 | + } |
| 40 | + ``` |
| 41 | ++* std::is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] |
| 42 | + |
| 43 | + この方法には、以下の問題もあった。 |
| 44 | + |
| 45 | +</code></pre></summary> |
| 46 | + |
| 47 | + <author> |
| 48 | + <name>Akira Takahashi</name> |
| 49 | + <email>faithandbrave@gmail.com</email> |
| 50 | + </author> |
| 51 | + </entry> |
| 52 | + |
9 | 53 | <entry> |
10 | 54 | <title>コンパイラの実装状況 -- C++23 : 「auto(x)による一時オブジェクトへの変換」を追加 (close #1254)</title> |
11 | 55 | <link href="https://cpprefjp.github.io/implementation-status.html"/> |
@@ -7979,33 +8023,6 @@ index b08b6ab01..2ed84d6e6 100644 |
7979 | 8023 | + - `value`の定義が変更されたことにともない、変換先の型が、包んでいる値がスカラー型である場合に参照ではなく値となった。仕様としてはC++29に導入されるが、C++26に対する欠陥報告 (DR) である |
7980 | 8024 | - [LWG Issue 4468. `operator decltype(auto)` is ill-formed](https://cplusplus.github.io/LWG/issue4468) |
7981 | 8025 | - この変換演算子はP2781R9では`operator decltype(auto)()`と宣言されていたが、CWG 1670により変換関数の型指定子として`decltype(auto)`を書くことは不適格であるため、`operator decltype(value)()`へ修正された(変換先の型は変わらない構文上の修正) |
7982 | | -</code></pre></summary> |
7983 | | - |
7984 | | - <author> |
7985 | | - <name>Akira Takahashi</name> |
7986 | | - <email>faithandbrave@gmail.com</email> |
7987 | | - </author> |
7988 | | - </entry> |
7989 | | - |
7990 | | - <entry> |
7991 | | - <title>type_order -- type_order : Clang 24 (trunk) で実装された</title> |
7992 | | - <link href="https://cpprefjp.github.io/reference/compare/type_order.html"/> |
7993 | | - <id>ae451fc93a7741a29c7ff10586f8513f6f03c9ec:reference/compare/type_order.md</id> |
7994 | | - <updated>2026-09-02T09:45:57+09:00</updated> |
7995 | | - |
7996 | | - <summary type="html"><pre><code>diff --git a/reference/compare/type_order.md b/reference/compare/type_order.md |
7997 | | -index 35643a8ff..e89e7d819 100644 |
7998 | | ---- a/reference/compare/type_order.md |
7999 | | -+++ b/reference/compare/type_order.md |
8000 | | -@@ -80,7 +80,7 @@ int main() { |
8001 | | - - C++26 |
8002 | | - |
8003 | | - ### 処理系 |
8004 | | --- [Clang](/implementation.md#clang): 22 [mark noimpl] |
8005 | | -+- [Clang](/implementation.md#clang): 24 [mark verified] |
8006 | | - - [GCC](/implementation.md#gcc): 16 [mark verified] |
8007 | | - - [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] |
8008 | | - |
8009 | 8026 | </code></pre></summary> |
8010 | 8027 |
|
8011 | 8028 | <author> |
|
0 commit comments