Chapter 5. Working with Classes

Now that you understand the benefits of encapsulation and how to build objects with class constructors, let's learn more about what you can do with class definitions. This chapter explores namespaces with classes, class containment, static class members, and pointers to class members. We also discuss how to use friend and nested classes in designs and why the explicit keyword helps control unwanted type conversions. These concepts give you all the tools you'll need to formulate the right class definition for the right application.

Get Navigating C++ and Object-Oriented Design 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.