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 exceptions — namespaces — using — using namespace — avoiding name clashes — name lookup — namespace composition — namespace aliases — namespaces and C code — exceptions — throw and catch — exceptions and program structure — advice — exercises.
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.