How are exceptions allocated on the stack caught beyond their scope?

前端 未结 6 1518
小蘑菇
小蘑菇 2020-12-09 08:44

In the following code, the stack-based variable \'ex\' is thrown and caught in a function beyond the scope in which ex was declared. This seems a bit strange to me, since (A

6条回答
  •  北海茫月
    2020-12-09 09:08

    Because the specification explicitly states, that a temporary object is created in place of the throw operand.

提交回复
热议问题