References and Value Categories
Lvalue References
References allow you to give a second name to an object that already exists. When you declare a reference, you aren't creating a new object that is copied and r…
Passing by Reference
When a parameter is passed by lvalue reference, the function receives an alternative name (another identifier) for the same object that the caller currently pos…
Const References
A const lvalue reference is an alias which has an additional limitation: the name may be invoked only to examine the object, not to change it. const does not in…
Returning by Reference
When a function returns an lvalue reference, it’s essentially providing a new alias for something that’s already alive. There’s absolutely no copy involved here…
Dangling References
A dangling reference is one that refers to an object that has been destroyed. When a reference is formed to an object's memory, the reference itself stores no i…
Rvalue References
Normal lvalue references won't take temporaries. That limit keeps names from dangling, but it does keep us from a useful pattern: where a transient needs to han…
Temporary Objects
The evaluation of an expression may result in a value that never acquires its own name:The compiler must still reserve a place to hold the result while the expr…