NL.9:全字母大写仅用于宏名称
To avoid confusing macros with names that obey scope and type rules.
为了避免将宏与遵循范围和类型规则的名称混淆。
Example(示例)
void f()
{
const int SIZE{1000}; // Bad, use 'size' instead
int v[SIZE];
}
This rule applies to non-macro symbolic constants:
此规则适用于非宏符号常量:
enum bad { BAD, WORSE, HORRIBLE }; // BAD
原文链接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl9-use-all_caps-for-macro-names-only