STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Typedefs | Functions | Variables
exception File Reference
#include <type_traits>

Classes

class  exception
 
class  bad_exception
 
class  bad_alloc
 
class  exception_ptr
 
class  nested_exception
 
struct  _With_nested< _Ty, _Uty >
 

Macros

#define _EXCEPTION_
 
#define _USE_EXCEPTION   using _STDEXT exception;
 
#define _USE_BAD_EXCEPTION
 
#define _USE_EX
 

Typedefs

typedef void(__cdecl * unexpected_handler) ()
 

Functions

_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception () _NOEXCEPT
 
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions () _NOEXCEPT
 
_STDEXT_END _STD_BEGIN _USE_EXCEPTION typedef void (__cdecl *_Prhand)(const exception &)
 
terminate_handler __CRTDECL set_terminate (terminate_handler) _THROW0()
 
unexpected_handler __CRTDECL set_unexpected (unexpected_handler) _THROW0()
 
void __CRTDECL terminate () _NOEXCEPT
 
void __CRTDECL unexpected ()
 
terminate_handler __CRTDECL get_terminate () _NOEXCEPT
 
unexpected_handler __CRTDECL get_unexpected () _NOEXCEPT
 
_STD_END _STD_BEGIN _USE_BAD_EXCEPTION _STD_END _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate (_Out_ void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy (_Inout_ void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy (_Out_ void *, _In_ const void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrAssign (_Inout_ void *, _In_ const void *)
 
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrCompare (_In_ const void *, _In_ const void *)
 
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrToBool (_In_ const void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap (_Inout_ void *, _Inout_ void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException (_Out_ void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrRethrow (_In_ const void *)
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopyException (_Inout_ void *, _In_ const void *, _In_ const void *)
 
void swap (exception_ptr &_Lhs, exception_ptr &_Rhs) throw ()
 
bool operator== (const exception_ptr &_Lhs, const exception_ptr &_Rhs) throw ()
 
bool operator== (nullptr_t, const exception_ptr &_Rhs) throw ()
 
bool operator== (const exception_ptr &_Lhs, nullptr_t) throw ()
 
bool operator!= (const exception_ptr &_Lhs, const exception_ptr &_Rhs) throw ()
 
bool operator!= (nullptr_t _Lhs, const exception_ptr &_Rhs) throw ()
 
bool operator!= (const exception_ptr &_Lhs, nullptr_t _Rhs) throw ()
 
exception_ptr current_exception () _NOEXCEPT
 
void rethrow_exception (_In_ exception_ptr _Ptr)
 
template<class _Ex >
void__GetExceptionInfo (_Ex)
 
template<class _Ex >
exception_ptr make_exception_ptr (_Ex _Except) _NOEXCEPT
 
template<class _Ty >
void _Throw_with_nested (_Ty &&_Arg, true_type)
 
template<class _Ty >
void _Throw_with_nested (_Ty &&_Arg, false_type)
 
template<class _Ty >
void throw_with_nested (_Ty &&_Arg)
 
template<class _Ty >
void _Rethrow_if_nested (const _Ty *_Ptr, true_type)
 
template<class _Ty >
void _Rethrow_if_nested (const _Ty *, false_type)
 
template<class _Ty >
void rethrow_if_nested (const _Ty &_Arg)
 

Variables

_CRTIMP2_NCEEPURE _Prhand _Raise_handler
 

Macro Definition Documentation

#define _EXCEPTION_
#define _USE_BAD_EXCEPTION
Value:
using _STDEXT bad_alloc; \
using _STDEXT bad_exception;
Definition: exception:160
Definition: exception:139
#define _USE_EX
Value:
using ::set_terminate; using ::terminate_handler; using ::terminate; \
void __CRTDECL unexpected()
Definition: exception:212
void __CRTDECL terminate() _NOEXCEPT
Definition: exception:208
void(__cdecl * unexpected_handler)()
Definition: exception:193
unexpected_handler __CRTDECL set_unexpected(unexpected_handler) _THROW0()
Definition: exception:202
terminate_handler __CRTDECL set_terminate(terminate_handler) _THROW0()
Definition: exception:196
#define _USE_EXCEPTION   using _STDEXT exception;

Typedef Documentation

typedef void(__cdecl * unexpected_handler) ()

Function Documentation

_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrAssign ( _Inout_ void ,
_In_ const void  
)
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrCompare ( _In_ const void ,
_In_ const void  
)
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy ( _Out_ void ,
_In_ const void  
)
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopyException ( _Inout_ void ,
_In_ const void ,
_In_ const void  
)
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException ( _Out_ void )
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy ( _Inout_ void )
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrRethrow ( _In_ const void )
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap ( _Inout_ void ,
_Inout_ void  
)
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrToBool ( _In_ const void )
template<class _Ex >
void* __GetExceptionInfo ( _Ex  )
template<class _Ty >
void _Rethrow_if_nested ( const _Ty *  _Ptr,
true_type   
)
inline
451  { // use dynamic_cast
452  const auto _Nested = dynamic_cast<const nested_exception *>(_Ptr);
453 
454  if (_Nested)
455  _Nested->rethrow_nested();
456  }
Definition: exception:377
void rethrow_nested() const
Definition: exception:389
template<class _Ty >
void _Rethrow_if_nested ( const _Ty *  ,
false_type   
)
inline
460  { // can't use dynamic_cast
461  }
template<class _Ty >
void _Throw_with_nested ( _Ty &&  _Arg,
true_type   
)
inline
420  { // throw user exception glued to nested_exception
421  typedef typename remove_reference<_Ty>::type _Uty;
422  typedef _With_nested<_Ty, _Uty> _Glued;
423 
424  _THROW_NCEE(_Glued, _STD forward<_Ty>(_Arg));
425  }
#define _THROW_NCEE(x, y)
Definition: xstddef:78
_Ty type
Definition: xtr1common:302
Definition: exception:409
template<class _Ty >
void _Throw_with_nested ( _Ty &&  _Arg,
false_type   
)
inline
429  { // throw user exception by itself
430  typedef typename decay<_Ty>::type _Decayed;
431 
432  _THROW_NCEE(_Decayed, _STD forward<_Ty>(_Arg));
433  }
#define _THROW_NCEE(x, y)
Definition: xstddef:78
Definition: type_traits:1356
exception_ptr current_exception ( )
inline
360  {
362  }
static exception_ptr _Current_exception()
Definition: exception:300
terminate_handler __CRTDECL get_terminate ( )
inline
217  { // get current terminate handler
218  return (0);
219  }
unexpected_handler __CRTDECL get_unexpected ( )
inline
222  { // get current unexpected handler
223  return (0);
224  }
template<class _Ex >
exception_ptr make_exception_ptr ( _Ex  _Except)
372  {
374  }
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
static exception_ptr _Copy_exception(_In_ void *_Except, _In_ const void *_Ptr)
Definition: exception:307
void * __GetExceptionInfo(_Ex)
bool operator!= ( const exception_ptr _Lhs,
const exception_ptr _Rhs 
)
throw (
)
inline
345  {
346  return !(_Lhs == _Rhs);
347  }
bool operator!= ( nullptr_t  _Lhs,
const exception_ptr _Rhs 
)
throw (
)
inline
350  {
351  return !(_Lhs == _Rhs);
352  }
bool operator!= ( const exception_ptr _Lhs,
nullptr_t  _Rhs 
)
throw (
)
inline
355  {
356  return !(_Lhs == _Rhs);
357  }
bool operator== ( const exception_ptr _Lhs,
const exception_ptr _Rhs 
)
throw (
)
inline
330  {
331  return __ExceptionPtrCompare(&_Lhs, &_Rhs);
332  }
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrCompare(_In_ const void *, _In_ const void *)
bool operator== ( nullptr_t  ,
const exception_ptr _Rhs 
)
throw (
)
inline
335  {
336  return !_Rhs;
337  }
bool operator== ( const exception_ptr _Lhs,
nullptr_t   
)
throw (
)
inline
340  {
341  return !_Lhs;
342  }
void rethrow_exception ( _In_ exception_ptr  _Ptr)
inline
365  {
366  _Ptr._RethrowException();
367  }
template<class _Ty >
void rethrow_if_nested ( const _Ty &  _Arg)
inline
465  { // detect nested_exception inheritance
470 
471  _Rethrow_if_nested(_STD addressof(_Arg), _Tag);
472  }
Definition: xtr1common:22
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
Definition: type_traits:982
Definition: type_traits:347
Definition: type_traits:427
#define bool
Definition: stdbool.h:15
void _Rethrow_if_nested(const _Ty *_Ptr, true_type)
Definition: exception:450
terminate_handler __CRTDECL set_terminate ( terminate_handler  )
inline
198  { // register a terminate handler
199  return 0;
200  }
unexpected_handler __CRTDECL set_unexpected ( unexpected_handler  )
inline
204  { // register an unexpected handler
205  return 0;
206  }
void swap ( exception_ptr _Lhs,
exception_ptr _Rhs 
)
throw (
)
inline
325  {
326  __ExceptionPtrSwap(&_Lhs, &_Rhs);
327  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void *, _Inout_ void *)
void __CRTDECL terminate ( )
inline
209  { // handle exception termination
210  }
template<class _Ty >
void throw_with_nested ( _Ty &&  _Arg)
inline
437  { // throw user exception, glued to nested_exception if possible
438  typedef typename remove_reference<_Ty>::type _Uty;
439 
443  && !is_final<_Uty>::value> _Tag;
444 
445  _Throw_with_nested(_STD forward<_Ty>(_Arg), _Tag);
446  }
Definition: xtr1common:22
void _Throw_with_nested(_Ty &&_Arg, true_type)
Definition: exception:419
Definition: type_traits:982
#define bool
Definition: stdbool.h:15
_Ty type
Definition: xtr1common:302
Definition: type_traits:441
Definition: type_traits:320
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception ( )
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions ( )
void __CRTDECL unexpected ( )
inline
213  { // handle unexpected exception
214  }
_STDEXT_END _STD_BEGIN typedef void ( __cdecl *  _Prhand) const

Variable Documentation

_CRTIMP2_NCEEPURE _Prhand _Raise_handler