Drawbacks of exceptions being globally allocated
Paul Backus
snarwin at gmail.com
Sun Aug 15 20:23:03 UTC 2021
On Sunday, 15 August 2021 at 18:47:27 UTC, Tejas wrote:
> Do you see anything wrong with the following
> `emplace`-allocated, RAII following exceptions:
>
> [...]
>
> Is this good enough for general use now? Any other drawbacks?
It only works if you're throwing and catching in the same
function. Otherwise you are essentially returning a pointer to an
expired stack frame, which is UB.
More information about the Digitalmars-d-learn
mailing list