Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 3.32 KB

exception.md

File metadata and controls

62 lines (51 loc) · 3.32 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
<exception> | Microsoft Docs
11/04/2016
cpp-standard-libraries
article
<exception>
C++
exception header
28900768-5dd7-4834-b907-5e37ab3407db
20
corob-msft
corob
ghogen

<exception>

Defines several types and functions related to the handling of exceptions. Exception handling is used in situations in which the system can recover from an error. It provides a means for control to be returned from a function to the program. The objective of incorporating exception handling is to increase the program's robustness while providing a way to recover from an error in an orderly fashion.

Syntax

#include <exception>  
  

Typedefs

exception_ptr A type that describes a pointer to an exception.
terminate_handler A type that describes a pointer to a function suitable for use as a terminate_handler.
unexpected_handler A type that describes a pointer to a function suitable for use as an unexpected_handler.

Functions

current_exception Obtains a pointer to the current exception.
get_terminate Obtains the current terminate_handler function.
get_unexpected Obtains the current unexpected_handler function.
make_exception_ptr Creates an exception_ptr object that holds a copy of an exception.
rethrow_exception Throws an exception passed as a parameter.
set_terminate Establishes a new terminate_handler to be called at the termination of the program.
set_unexpected Establishes a new unexpected_handler to be when an unexpected exception is encountered.
terminate Calls a terminate handler.
uncaught_exception Returns true only if a thrown exception is being currently processed.
unexpected Calls an unexpected handler.

Classes

bad_exception Class The class describes an exception that can be thrown from an unexpected_handler.
exception Class The class serves as the base class for all exceptions thrown by certain expressions and by the C++ Standard Library.

See Also

Header Files Reference
Thread Safety in the C++ Standard Library