aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes
diff options
context:
space:
mode:
Diffstat (limited to 'public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes')
-rw-r--r--public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html12
1 files changed, 4 insertions, 8 deletions
diff --git a/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html b/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
index ae44da9..ed91b45 100644
--- a/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
+++ b/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
@@ -56,8 +56,7 @@
タイトル落ち。まずはこのコードを見て欲しい。
</p>
- <pre class="highlight" language="cpp" linenumbering="unnumbered">
- <code>#include &lt;iostream&gt;
+ <pre class="highlight" language="cpp" linenumbering="unnumbered"><code>#include &lt;iostream&gt;
[[alignas]] [[alignof]] [[and]] [[and_eq]] [[asm]] [[auto]] [[bitand]]
[[bitor]] [[bool]] [[break]] [[case]] [[catch]] [[char]] [[char16_t]]
@@ -75,8 +74,7 @@
// [[using]]
int main() {
std::cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; std::endl;
-}</code>
- </pre>
+}</code></pre>
<blockquote>
<p>
@@ -126,10 +124,8 @@ std::cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; std::endl;
上のコードでは<code>[[using]]</code>をコメントアウトしているが、これは<code>using</code>キーワードのみ属性構文の中で意味を持つからであり、このコメントアウトを外すとコンパイルに失敗する。
</p>
- <pre class="highlight" language="cpp" linenumbering="unnumbered">
- <code>// using の例
-[[using foo: attr1, attr2]] int x; // [[foo::attr1, foo::attr2]] の糖衣構文</code>
- </pre>
+ <pre class="highlight" language="cpp" linenumbering="unnumbered"><code>// using の例
+[[using foo: attr1, attr2]] int x; // [[foo::attr1, foo::attr2]] の糖衣構文</code></pre>
<p>
C++17 の仕様も見てみる (正確には標準化前のドラフト)。