C++ Migration Guide

Standard Exceptions

The C++ 4.2 compiler used the names related to standard exceptions that appeared in the C++ draft standard at the time the compiler was prepared. The names in the C++ standard have changed since then. The C++ 5.0 compiler in standard mode uses the standard names, as shown in the following table.

Table 3-3 Exception-Related Type Names

Old name 

Standard name 

Description 

xmsg

exception

Base class for standard exceptions 

xalloc

bad_alloc

Thrown by failed allocation request 

terminate_function

terminate_handler

Type of a terminate handler function 

unexpected_function

unexpected_handler

Type of an unexpected-exception handler function 

The public members of the classes (xmsg vs. exception, and xalloc vs. bad_alloc) are different, as is the way you use the classes.