The Secret Life of C++: References

References are Just Pointers

Let's start with something simple, references. References are just pointers. Really.


        

        

        

        

        

Conventions are good

The google coding standard says that you should only use const references, for the efficiency of not copying method arguments, and you should use pointers for non-const arguments that will be changed. This is good because at call sites you can see which arguments are being modified and which are not.

Fork me on GitHub