C++核心准则ES.32:宏定义名称全部大写
ES.32: Use ALL_CAPS for all macro names
ES.32:宏定义名称全部大写
Reason(原因)
Convention. Readability. Distinguishing macros.
习惯。可读性。区分宏定义。
Example(示例)
#define forever for (;;) /* very BAD */
#define FOREVER for (;;) /* Still evil, but at least visible to humans */
Enforcement(实施建议)
Scream when you see a lower case macro.
如果看到小写的宏定义,尖叫!
原文链接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es32-use-all_caps-for-all-macro-names
觉得本文有帮助?请分享给更多人。
关注微信公众号【面向对象思考】轻松学习每一天!
面向对象开发,面向对象思考!
评论