1. Advantages of passing parameters with Reference-to-const:
Avoid the construction and destruction of local objects, save time and space;
Avoid "object cutting" when the parameter-derived class object is passed to the base class object, and implement object-oriented;
2. Although reference is an "alias", the underlying implementation is often a pointer, so for built-in types, the choice of pass-by-value is more efficient. This also applies to STL iterators and function objects, because they are traditionally designed to be pass-by-value, But not the object of a small choice pass-by-value efficiency is high, mainly for the following reasons:
object contains pointers to heap memory;
Some compilers put built-in types in the cache, but do not put objects containing only one built-in type into the cache (the object's reference is a built-in type);
User-defined type its internal implementation may change (objects may become larger)
3. In general, the use of Pass-by-value to compare the appropriate object is generally only built-in type, STL iterator and function object, the other best replaced with Pass-b0reference-to-const pass-by-value
Effective C + + clause 20 ning with Pass-by-reference-to-const replacement Pass-by-value