[1] Be suspicious of non-const reference arguments,if you want the function to modify its arguments,use pointers and value return instead;
[2] Use const reference arguments when you need to minimize copying of arguments;
[3] Use const extensively and consisiently;
[4] Avoid macros;
[5] Avoid unspecified numbers of arguments;
[6] Don't return pointers or references to local variables;
[7] Use overloading when functions perform conceptually the same task on different types;
[8] When overloading on integers,provide functions to eliminate common ambiguities;
[9] When considering the use of a pointer to function,consider whether a virtual function of a template would be a better alternative;
[10]If you must use macros,use ugly names with lots of capital letters
[2] Use const reference arguments when you need to minimize copying of arguments;
[3] Use const extensively and consisiently;
[4] Avoid macros;
[5] Avoid unspecified numbers of arguments;
[6] Don't return pointers or references to local variables;
[7] Use overloading when functions perform conceptually the same task on different types;
[8] When overloading on integers,provide functions to eliminate common ambiguities;
[9] When considering the use of a pointer to function,consider whether a virtual function of a template would be a better alternative;
[10]If you must use macros,use ugly names with lots of capital letters
转载于:https://blog.51cto.com/virus/20808