Summary
In this chapter, we have furthered our C++ programming endeavors beyond OOP language features to include features that will enable us to write more extensible programs. We have learned how to utilize friend functions and friend classes and we have learned how to overload operators in C++.
We have seen that friend functions and classes should be used sparingly and with caution. They are not meant to provide a blatant means to circumvent access regions. Instead, they are meant to handle programming situations to allow access between two tightly coupled classes without providing the alternative of an overly public interface in either of those classes, which could be misused on a broader scale.
We have seen how to overload operators in C++ using operator functions, both as member and non-member functions. We have learned that overloading operators will allow us to extend the meaning of C++ operators to include user defined types in the same way they encompass standard types...