メモの日々


2025年12月03日(水) [長年日記]

[c++] C++で宣言に書く指定子の順序

C++の宣言に書く指定子の順序に言及した文書が https://github.com/cplusplus/draft のWikiにあったのでメモ。

In a decl-specifier-seq, the decl-specifiers should be written in the following order:

  1. friend / typedef / storage-class-specifier / virtual
  2. inline
  3. constexpr
  4. explicit-specifier
  5. const
  6. volatile
  7. unsigned / signed
  8. short / long
  9. other type-specifiers