Season of Docs

Nicholas Wilson iamthewilsonator at hotmail.com
Tue Mar 19 10:10:27 UTC 2019


On Tuesday, 19 March 2019 at 09:37:21 UTC, Paolo Invernizzi wrote:
> On Tuesday, 19 March 2019 at 07:33:28 UTC, Walter Bright wrote:
>> Then generic code would have to be special cased (by the user) 
>> for it.
>
> Sorry, I don't understand...
>
> I mean, raising a compiling error if scope is applied to values 
> that do not contain any references, so that it would be 
> ignored, because it applies to references:
>
> `foo(scope int p)` => compiler error...

`foo(scope T p)` => compiler error?

Depends what `T` is, that is very annoying to have to deal with 
in generic code. That is why it is currently ignored if it does 
nothing. Unfortunately we can't have our cake and eat it too.


More information about the Digitalmars-d mailing list