aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml')
-rw-r--r--content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml38
1 files changed, 13 insertions, 25 deletions
diff --git a/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml b/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
index f212b7c..4ee22fe 100644
--- a/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
+++ b/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
@@ -53,15 +53,15 @@ std::cout << "Hello, World!" << std::endl;
<blockquote>
<itemizedlist>
<listitem>
- <simpara>the identifiers that are keywords cannot be used for other purposes;</simpara>
+ the identifiers that are keywords cannot be used for other purposes;
<itemizedlist>
<listitem>
- <simpara>The only place they can be used as non-keywords is in an
- attribute-token. (e.g. [[private]] is a valid attribute) (since C++11)</simpara>
- </listitem>
- </itemizedlist>
- </listitem>
-</itemizedlist>
+ The only place they can be used as non-keywords is in an
+ attribute-token. (e.g. [[private]] is a valid attribute) (since C++11)
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
</blockquote>
<simpara>キーワードでも属性として指定する場合は非キーワードとして使えるらしい。
実際にやってみる。</simpara>
@@ -91,24 +91,12 @@ std::cout &lt;&lt; "Hello, World!" &lt;&lt; std::endl;
(参考:
<link xl:href="https://timsong-cpp.github.io/cppwp/n4659/lex.digraph">同ドラフト</link>)</simpara>
<itemizedlist>
- <listitem>
- <simpara><literal>&lt;%</literal> → <literal>{</literal></simpara>
- </listitem>
- <listitem>
- <simpara><literal>%&gt;</literal> → <literal>}</literal></simpara>
- </listitem>
- <listitem>
- <simpara><literal>&lt;:</literal> → <literal>[</literal></simpara>
- </listitem>
- <listitem>
- <simpara><literal>:&gt;</literal> → <literal>]</literal></simpara>
- </listitem>
- <listitem>
- <simpara><literal>%:</literal> → <literal>#</literal></simpara>
- </listitem>
- <listitem>
- <simpara><literal>%:%:</literal> → <literal>##</literal></simpara>
- </listitem>
+ <listitem><literal>&lt;%</literal> → <literal>{</literal></listitem>
+ <listitem><literal>%&gt;</literal> → <literal>}</literal></listitem>
+ <listitem><literal>&lt;:</literal> → <literal>[</literal></listitem>
+ <listitem><literal>:&gt;</literal> → <literal>]</literal></listitem>
+ <listitem><literal>%:</literal> → <literal>#</literal></listitem>
+ <listitem><literal>%:%:</literal> → <literal>##</literal></listitem>
</itemizedlist>
<simpara>「<literal>identifier</literal>
の構文上の要件を満たさないような代替トークン」はこれらが当てはまると思われる。</simpara>