DIP 1008 Preliminary Review Round 1
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 26 01:45:40 PDT 2017
On 5/25/2017 12:30 AM, Andrei Alexandrescu wrote:
> On 5/25/17 6:24 AM, Walter Bright wrote:
>> On 5/23/2017 3:40 PM, Martin Nowak wrote:
>>> Why does it have to be refcounted? Seems like there is only ever one
>>> reference to the current exception (the catch variable).
>>
>> Rethrowing the catch variable makes for 2 references.
>
> Why doesn't the rethrow count as a move? There is no way it can be reused in the
> scope that rethrows. -- Andrei
It could be - it's just that there's nothing currently in the compiler to
support the notion of moves. So the destructor will still wind up getting called
on it.
It's a good idea for a future enhancement, though.
More information about the Digitalmars-d
mailing list