October 1999
Beginner
304 pages
7h 11m
English
Catch clauses are associated with try blocks. A try block begins with the try keyword followed by a sequence of program statements enclosed in braces. The catch clauses are placed at the end of the try block, and they represent the exceptions that are handled if an exception is thrown during execution of the statements within the try block.
For example, the following function looks for elem within a range of elements marked by first, last. The iteration over the range can potentially result in an iterator_overflow exception being thrown, so we place that code within a try block followed by a catch clause that contains an iterator_overflow exception declaration:
bool has_elem( Triangular_iterator first, Triangular_iterator ...
Read now
Unlock full access