Welcome to My Public Vault

Home

❯

属性(C++)

属性(C++)

Apr 15, 20261 min read

  • CPlusPlus

宣言(C++)や文(プログラミング)などに付けて、そのコードをどう扱うかについての追加情報をコンパイラに伝えるための書き方。 属性は[[attr]]のように二重角括弧で囲んで指定する。

例:

[[nodiscard]] int f();
[[maybe_unused]] int x;

参考

  • https://cpprefjp.github.io/lang/cpp11/attributes.html

Graph View

Backlinks

  • C++(Roadmap)
  • maybe_unused属性

Created with Quartz v4.5.2 © 2026

  • GitHub
  • Discord Community