DIP69 - Implement scope for escape proof references

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 11 22:32:15 PST 2014


On 12/11/2014 10:04 PM, Dicebot wrote:
> On Thursday, 11 December 2014 at 08:30:55 UTC, Walter Bright wrote:
>> On 12/10/2014 10:43 PM, Dicebot wrote:
>>> On Thursday, 11 December 2014 at 03:30:07 UTC, Walter Bright wrote:
>>>> If you want data to 'escape' from r.front, then it shouldn't be marked as
>>>> scope. Definitely, using scope successfully will require some rethinking of
>>>> how code is written.
>>>
>>> Allowing or prohibiting escaping of r.front in that example depends on
>>> definition of mapped range. There is nothing to "rethink" about it - case is
>>> almost identical to const+inout.
>>
>> One reason why with templates, they'll do scope inference.
>
> So the answer really is "current proposal does not support it"? Well this alone
> seems limiting enough for me to kills the whole DIP. "Use templates everywhere"
> is not really an answer, we could as well just prohibit separate compilation
> without .di files and enjoy full source availability as inherent requirement.

When you're relying on the definition of an argument, it is inherently a template.


More information about the Digitalmars-d mailing list