scope ref const(T) --> error?!
Tove
tove at fransson.se
Thu May 3 17:28:31 PDT 2012
On Thursday, 3 May 2012 at 22:43:16 UTC, Tove wrote:
>> scope does not destroy. scope makes this illegal (assuming
>> that A is a class type):
>>
>> a = x;
>>
>> There is deprecated use of the 'scope' keyword but this is not
>> it.
>>
>> > }
>> >
>> > fun(a);
>> >
>>
>> Ali
>
> right, thanks. I forgot about that, since it was never
> implemented I didn't use it.
>
> But nevertheless... the actual implemented semantics is the
> same for parameters as for the deprecated function body case,
> at the end of the function the parameter goes out of scope too!
> i.e. destructor should be called.
Hmmm sorry for the confusion, I was living under the delusion
that:
scope class A{}
void fun(scope A x){}
fun(new A());
did something, but it doesn't. ;)
More information about the Digitalmars-d
mailing list