Summary
In this chapter, we have learned numerous aspects of C++ references. We have taken the time to understand reference basics, such as declaring and initializing reference variables to existing objects, as well as how to access reference components for basic and user defined types.
We have seen how to utilize references in a meaningful fashion with functions, both as input parameters and as a return value. We have also seen when it is reasonable to apply the const
qualifier to references, as well as seen how this concept can be combined with parameters and return values from functions. Lastly, we have seen the underlying implementation of references. This has helped explain some of the restrictions references encompass, as well as understand which cases of indirect addressing will require the use of pointers instead of references.
As with pointers, all of the skills using references from this chapter will be used freely in the upcoming chapters. C++ allows programmers to...