注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 Java程序发生异常就挂了吗?
 帮助

TIPS FOR C++3


2007-03-27 17:16:17
 标签:c++   [推送到技术圈]

[1]Define operators primarily to mimic conventional usage;
[2]For large operands,use const reference argument types;
[3]For large results,consider optimizing the return;
[4]Prefer the default copy operations if appropriate for a class;
[5]Redefine or prohibit copying if the default is not appropriate for a type;
[6]Prefer member functions over nonmembers for operations that need access to the representation;
[7]Prefer nonmember functions over members for operations that do not need access to the representation;
[8]Use namespaces to associate helper functions with "their" class;
[9]Use nonmember functions for symmetric operators;
[10]Use () for subscripting multidimensional arrays;
[11]Make constructors that take a single "size argument" explicit;
[12]For non-specialized uses,prefer the standard string to the result of your own exercises;
[13]Be cauious about introducing implicit conversions;
[14]Use member functions to express operators that require an lvalue as its left-hand operand;


上一篇 TIPS FOR C++2  下一篇 TIPS FOR C++



    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: