posts - 9, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

c++ resource allocation new statement

Posted on 2012-11-27 10:03 魏尚堂 阅读(127) 评论(0)  编辑 收藏 引用

Perform every resource allocation (e.g., new) in its own code statement which immediately gives the new resource to a manager object (e.g., auto_ptr).

This guideline is easy to understand and remember, it neatly avoids all of the exception safety problems in the original problem, and by mandating the use of manager objects it helps to avoid many other exception safety problems as well. This guideline is a good candidate for inclusion in your team's coding standards

link http://www.gotw.ca/gotw/056.htm

file I/O http://www.zwqxin.com/archives/cpp/use-sstream.html


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理