码迷,mamicode.com
首页 > 编程语言 > 详细

<Effective C++>读书摘要--Designs and Declarations<二>

时间:2015-04-19 19:08:23      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:

<Item 20> Prefer pass-by-reference-to-const to pass-by-value

1、By default, C++ passes objects to and from functions by value (a characteristic it inherits from C). Unless you specify otherwise, function parameters are initialized with copies of the actual arguments, and function callers get back a copy of the value returned by the function. These copies are produced by the objects‘ copy constructors. This can make pass-by-value an expensive operation. 

<Effective C++>读书摘要--Designs and Declarations<二>

标签:

原文地址:http://www.cnblogs.com/GloryLion/p/4439490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!