MSVC calls the destructor for the return-value in the first case, but not in the second. Is this a bug in three major compilers or am I just entering UB territory by throwing from a destructor?
-
-
Prikaži ovu nit
-
For some context - I was wondering what the behaviour should be if an exception is thrown during destruction/cleanup of local state in a coroutine after a co_return. I thought it should be consistent with normal functions. Now I'm not so sure...
Prikaži ovu nit -
From the C++ WD [except.ctor]: > ... If an exception is thrown during the destruction of temporaries or local variables for a return statement, the destructor for the returned object (if any) is also invoked. ...
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.