diff options
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.xml | 38 |
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 << "Hello, World!" << std::endl; (参考: <link xl:href="https://timsong-cpp.github.io/cppwp/n4659/lex.digraph">同ドラフト</link>)</simpara> <itemizedlist> - <listitem> - <simpara><literal><%</literal> → <literal>{</literal></simpara> - </listitem> - <listitem> - <simpara><literal>%></literal> → <literal>}</literal></simpara> - </listitem> - <listitem> - <simpara><literal><:</literal> → <literal>[</literal></simpara> - </listitem> - <listitem> - <simpara><literal>:></literal> → <literal>]</literal></simpara> - </listitem> - <listitem> - <simpara><literal>%:</literal> → <literal>#</literal></simpara> - </listitem> - <listitem> - <simpara><literal>%:%:</literal> → <literal>##</literal></simpara> - </listitem> + <listitem><literal><%</literal> → <literal>{</literal></listitem> + <listitem><literal>%></literal> → <literal>}</literal></listitem> + <listitem><literal><:</literal> → <literal>[</literal></listitem> + <listitem><literal>:></literal> → <literal>]</literal></listitem> + <listitem><literal>%:</literal> → <literal>#</literal></listitem> + <listitem><literal>%:%:</literal> → <literal>##</literal></listitem> </itemizedlist> <simpara>「<literal>identifier</literal> の構文上の要件を満たさないような代替トークン」はこれらが当てはまると思われる。</simpara> |
