effective c++ prefer const,enum, inline to #defines
学习心得
对于纯常量,最好以const对象或者enums替换#define
#define FIRST 3 //not good enum { first=1, second=2 } ; int num[first];
对于macros,最好用inline代替
#define CALL_MAX(a, b) f( (a)>(b) ? (a) : (b)) CALL_MAX(a++,b++); // not right results