Summing Up

You have now seen how to create several functions with the same name and different argument types, and how the compiler supports overloading those names. In addition, you have seen that you can overload operators; this lesson has shown you how to overload the insertion and assignment operators, but you can overload many others.

You have seen some of the pitfalls of overloading and will hopefully be careful when you use this feature.

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.