DIP 1008 Preliminary Review Round 1

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat May 27 01:54:44 PDT 2017


On 5/26/2017 11:50 PM, Atila Neves wrote:
> On Saturday, 27 May 2017 at 02:40:47 UTC, Walter Bright wrote:
>> On 5/26/2017 11:51 AM, Atila Neves wrote:
>>> Since it's `scope`, where would it be copied to? This is assuming dip1000, of 
>>> course.
>>
>> The rethrow case must be allowed:
>>
>>     throw ex;
> 
> Then either:
> 
> 1. Elide the destructor call in that situation

That's Andrei's "move semantics" idea, and it involves major code effort in the 
compiler.

There's the "chain" case, too.

> 2. Make the developer write `throw ex.dup`

The point is to not require them to rewrite their code.


> I'd prefer #2, since it would make a lot more sense for `scope`. `throw` escapes 
> the ex IMHO.
> 
> My $0.02
> 
> Atila



More information about the Digitalmars-d mailing list