This is before implementation. Different implementations are different policies, but for the most part they are associated with some special pre-allocated space, static or streaming local. (If you need to highlight the std::bad_alloc
, you are in trouble.)
As for your second case, this is not very similar, because an array of pointer conversions occur before the throw. So you're really just throwing a pointer; space for the pointer is processed as usual, but as soon as you left the block where the array was declared, it was gone. Even in the catch
(in your example), access to which is undefined behavior.
source share