Chapter 8. Namespaces and Exceptions

 

The year is 787! A.D.?

 
 --Monty Python
 

No rule is so general, which admits not some exception.

 
 --Robert Burton

Modularity, interfaces, and exceptionsnamespacesusingusing namespaceavoiding name clashesname lookupnamespace compositionnamespace aliasesnamespaces and C codeexceptionsthrow and catchexceptions and program structureadviceexercises.

Modularization and Interfaces

Any realistic program consists of a number of separate parts. For example, even the simple “Hello, world!” program involves at least two parts: the user code requests Hello, world! to be printed, and the I/O system does the printing.

Consider the desk calculator example from §6.1. It can be viewed as being ...

Get The C++ Programming Language, Special 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.