TIPS FOR C++3
短信预约 -IT技能 免费直播动态提醒
[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;
[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;
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341