Herausfinden ob momentan eine Exception behandlet wird
-
Hallo,
Ganz kurze Frage.
gibt es eine Möglichkeit herauszufinden, ob gerade ein Exception behandelt wir?
-
[EDIT: Hmmm, war ein netter Gedanke, wird aber von meinemn Compilern nicht bestätigt und im Std hab ich's auch nicht gefunden ... also weg damit]
-
Nein. Aber vielleicht interessiert dich
std::uncaught_exception().
-
Mit std::uncaught_exception() geht es.
Zitat von http://msdn2.microsoft.com/en-us/library/k1atwat8(VS.80).aspxReturns true only if a thrown exception is being currently processed.Edit: Link gefixt.
-
Mal eine Frage: Wofür brauchst Du das denn ?
Gruß,
Simon2.
-
Der Standard schrieb:
15.5.3 The uncaught_exception() function
The functionbool uncaught_exception() throw()returns true after completing evaluation of the object to be thrown until completing the initialization of
the exception-declaration in the matching handler (18.6.4). This includes stack unwinding. If the exception
is rethrown (15.1), uncaught_exception() returns true from the point of rethrow until the
rethrown exception is caught again.Header: <exception>