C++予約識別子

ちょっと思い違いしていた。

  • underscore2個で始まるものは予約。underscore + uppercaseで始まるものも予約。こいつらはどんなときもアウト。
  • underscoreで始まるものは、global namespace & ::std内で予約。

underscore + lowercaseはいつでもOKってわけではないらしい。


cf) 17.4.3.1.2

Each name that contains a double underscore ("__") or begins with an underscore followed by an uppercase letter (lex.key) is reserved to the implementation for any use.
Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.*
[Footnote: Such names are also reserved in namespace ::std (lib.reserved.names). --- end foonote]