std::current_exception
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <exception>
|
||
std::exception_ptr current_exception() |
(desde C++11) | |
Se for chamado durante o tratamento de exceção (normalmente, em uma cláusula
catch), capta o objeto de exceção atual e cria um std::exception_ptr que contém uma referência a esse objeto de exceção, ou de uma cópia do que objeto de exceção (que é definida pela implementação se uma cópia é feita)Original:
If called during exception handling (typically, in a
catch clause), captures the current exception object and creates an std::exception_ptr that holds a reference to that exception object, or to a copy of that exception object (it is implementation-defined if a copy is made)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Se a implementação desta função requer uma chamada para
new ea chamada falhar, o ponteiro retornado irá realizar uma referência a uma instância de std::bad_allocOriginal:
If the implementation of this function requires a call to
new and the call fails, the returned pointer will hold a reference to an instance of std::bad_allocThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Se a implementação desta função requer para copiar o objeto de exceção capturada e seu construtor cópia lança uma exceção, o ponteiro retornado irá realizar uma referência para a exceção lançada. Se o construtor de cópia do objeto exceção lançada também lança, o ponteiro retornado pode conter uma referência a uma instância de std::bad_exception para quebrar o loop infinito.
Original:
If the implementation of this function requires to copy the captured exception object and its copy constructor throws an exception, the returned pointer will hold a reference to the exception thrown. If the copy constructor of the thrown exception object also throws, the returned pointer may hold a reference to an instance of std::bad_exception to break the endless loop.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Se a função é chamada quando nenhuma exceção está sendo tratado, uma std::exception_ptr vazio é retornado.
Original:
If the function is called when no exception is being handled, an empty std::exception_ptr is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.