英文標題(Prefer consts, enums, and inlines to #defines)
理由:
①使用宏定義常量的過程中,出錯的時候難以調試,宏的常量在編譯時不進入符號表。
②使用宏定義的函數功能,極容易出現錯誤的期待結果。
Things to remember:
1.for simple constants, prefer const objects or enums to #define.
對於一般的常量,儘量使用const對象或者枚舉,而不用宏。
2.For function-like macros, prefer inline functions to #define.
對於類似函數的宏,儘量使用內聯函數。