File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -168,9 +168,9 @@ auto f() -> int&& {
168168
169169| 関数宣言と` return ` 文| C++20まで| C++23から| 備考|
170170| ---| :-:| :-:| ---|
171- | ` auto f(T x) -> decltype(x) { return x; } ` | ` T ` : 〇| ` T ` : 〇 ||
171+ | ` auto f(T x) -> decltype(x) { return x; } ` | ` T ` : 〇| ― ||
172172| ` auto f(T x) -> decltype((x)) { return (x); } ` | ` T& ` : 〇| ` T& ` : ** ×** | ローカル参照を返していた|
173- | ` auto f(T x) -> decltype(auto) { return x; } ` | ` T ` : 〇| ` T ` : 〇 ||
173+ | ` auto f(T x) -> decltype(auto) { return x; } ` | ` T ` : 〇| ― ||
174174| ` auto f(T x) -> decltype(auto) { return (x); } ` | ` T& ` : 〇| ** ` T&& ` :** 〇| ローカル参照を返す|
175175| ` auto f(T&& x) -> decltype(x) { return x; } ` | ` T&& ` : ×| ` T&& ` : ** 〇** ||
176176| ` auto f(T&& x) -> decltype((x)) { return (x); } ` | ` T& ` : 〇| ` T& ` : ** ×** ||
@@ -181,7 +181,11 @@ auto f() -> int&& {
181181| ` auto f(T&& x) -> auto&& { return x; } ` | ` T& ` : 〇| ** ` T&& ` :** 〇| ` x ` がローカル変数の場合ローカル参照を返す|
182182| ` auto f(T&& x) -> auto&& { return (x); } ` | ` T& ` : 〇| ** ` T&& ` :** 〇| ` x ` がローカル変数の場合ローカル参照を返す|
183183
184- 右側2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述しており、コンパイル可否は、〇が適格(コンパイルが通る)、×が不適格(コンパイルエラー)を表す。
184+ 表の中2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述している。また、表中の記号の意味は次のとおり
185+
186+ - 〇 : 適格(コンパイルが通る)
187+ - × : 不適格(コンパイルエラー)
188+ - ― : 変化なし
185189
186190## 例
187191
You can’t perform that action at this time.
0 commit comments