File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 276276| P2173R1: [ ラムダ式に対する属性] ( /lang/cpp23/attributes_on_lambda_expressions.md ) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - |
277277| P1774R8: [ コード内容の仮定をコンパイラに伝えるassume属性] ( /lang/cpp23/portable_assumptions.md ) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - |
278278| P2316R2: [ 文字リテラルエンコーディングを一貫させる] ( /lang/cpp23/consistent_character_literal_encoding.md ) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 |
279- | P2334R1: [ ` elif ` /` elifdef ` /` elifndef ` のサポートを追加] ( /lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink ) | ` #if ` /` #ifdef ` /` #ifndef ` に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - |
279+ | P2334R1: [ ` elif ` /` elifdef ` /` elifndef ` のサポートを追加] ( /lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md ) | ` #if ` /` #ifdef ` /` #ifndef ` に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - |
280280| P2437R1: [ ` #warning ` のサポートを追加] ( /lang/cpp23/warning.md ) | 多くのC++コンパイラが実装していたプリプロセス時の警告` #warning message ` を正式サポート | yes | yes | 2023.2 | yes |
281281| P2295R6: [ 汎用的なソースコードのエンコーディングとしてUTF-8をサポート] ( /lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink ) | | 13 | 15 | 2023.2 | 2019 Update 2 |
282282| P2223R2: [ 行末スペースを無視するよう規定] ( /lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink ) | 行末が「<code >\ </code >」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - |
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通
9696| 言語機能 | 説明 |
9797| ----------| ------|
9898| [ 文字リテラルエンコーディングを一貫させる] ( cpp23/consistent_character_literal_encoding.md ) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする |
99- | [ ` elif ` /` elifdef ` /` elifndef ` のサポートを追加] ( cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink ) | ` #if ` /` #ifdef ` /` #ifndef ` に対応する複数条件命令のサポートを追加する |
99+ | [ ` elif ` /` elifdef ` /` elifndef ` のサポートを追加] ( cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md ) | ` #if ` /` #ifdef ` /` #ifndef ` に対応する複数条件命令のサポートを追加する |
100100| [ ` #warning ` のサポートを追加] ( cpp23/warning.md ) | 多くのC++コンパイラが実装していたプリプロセス時の警告` #warning message ` を正式サポート |
101101| [ 汎用的なソースコードのエンコーディングとしてUTF-8をサポート] ( cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink ) | |
102102
Original file line number Diff line number Diff line change 1+ # elif/elifdef/elifndefのサポートを追加
2+ * cpp23[ meta cpp]
3+
4+ ## 概要
5+ C++23では、以下のプリプロセス時条件式が追加される:
6+
7+ - ` #if ` に対応する` #elif ` を追加。` #if ` /` #ifdef ` /` #ifndef ` が偽だった場合の条件式を記述できる
8+ - ` #ifdef ` に対応する` #elifdef ` を追加。` #if ` /` #ifdef ` /` #ifndef ` が偽だった場合の、特定の識別子が定義されているかの判定を記述できる
9+ - ` #ifndef ` に対応する` #elifndef ` を追加。` #if ` /` #ifdef ` /` #ifndef ` が偽だった場合の、特定の識別子が定義されていないかの判定を記述できる
10+
11+ これまでは` #if ` が偽だった場合のさらなる条件式を記述するためには` #else ` にネストして` #if ` を記述する必要があったが、そのような条件分岐が書きやすくなる。
12+
13+ ``` cpp
14+ #define FOO 2
15+
16+ #if FOO == 1
17+ /* * /
18+ #elif FOO == 2
19+ /* * /
20+ #elifdef BAR
21+ /* * /
22+ #elifndef HOGE
23+ /* * /
24+ #endif
25+ ```
26+
27+ これらのプリプロセス命令はC23でも追加されるため、C++でも同じく追加する。
28+
29+
30+ ## 参照
31+ - [ P2334R1 Add support for preprocessing directives elifdef and elifndef] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf )
You can’t perform that action at this time.
0 commit comments