Ray's playground

 

Item 20: Prefer pass-by-reference-to-const to pass-by-value(Effective C++)

Prefer pass-by-reference-to-const over pass-by-value. It's typically more efficient and it avoids the slicing problem.
The rule doesn't apply to built-in types and STL iterator and function object types. For them, pass-by-value is usually appropriate.

posted on 2011-03-24 21:35  Ray Z  阅读(167)  评论(0编辑  收藏  举报

导航