首页 > 编程语言 > 详细

[EC++_item3]任何可能的时候都使用const

时间:2014-04-06 23:57:29      阅读:988      评论:0      收藏:0      [点我收藏+]

Things to Rember

1.Declaring something const helps compilers detect usage errors. const can be applied to objects at

any scope, to function parameters and return types, and to member functions as a whole.

2.Compilers enforce bitwise constness, but you should program using conceptual constness.

3.When const and non-const member functions have essentially identical implementations, code

duplication can be avoided by having the non-const version call the const version.

[EC++_item3]任何可能的时候都使用const,布布扣,bubuko.com

[EC++_item3]任何可能的时候都使用const

原文:http://www.cnblogs.com/pansj/p/EffectiveCPlusPlus_Item_3.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!