Namespaces
Variants
Views
Actions

std::bad_exception

From cppreference.com
< cpp‎ | error
Revision as of 18:55, 26 March 2012 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/error/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <exception>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
class bad_exception : public std::exception;
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

std::bad_exception is the type of the exception thrown by the C++ runtime in the following situations:

1) If a dynamic exception specification is violated and Template:cpp throws or rethrows an exception that still violates the exception specification, but the exception specification allows std::bad_exception, std::bad_exception is thrown.

2) If Template:cpp stores a copy of the caught exception and if the copy constructor of the exception object caught by Template:cpp throws an exception, the captured exception is an instance of std::bad_exception.

Member functions

constructs the bad_exception object
(public member function of Template:cpp/error/exception/bad exception/title)
[virtual]
returns the explanatory string
(virtual public member function of Template:cpp/error/exception/bad exception/title)

Template:cpp/error/exception/exception/inherit

Example

Template:example cpp