您的位置:首页 > 编程语言 > C语言/C++

Adivce from the father of C++III

2007-03-18 13:24 507 查看
[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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++ 职场 休闲
相关文章推荐