Season of Docs

Paolo Invernizzi paolo.invernizzi at gmail.com
Tue Mar 19 14:30:47 UTC 2019


On Tuesday, 19 March 2019 at 10:10:27 UTC, Nicholas Wilson wrote:
> 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.

Understood, thanks


More information about the Digitalmars-d mailing list