On 04/12/2014 21:23, H. S. Teoh via Digitalmars-d wrote:
        @property scope ref T borrow() { return t; }
        alias borrow this;

While this DIP enabling the above to be memory-safe is awesome, a later tweak to AliasThis grammar to allow storage classes could make 'borrow' redundant. Plain alias now allows storage classes:

AliasDeclaration:
    alias StorageClassesopt BasicType Declarator ;

So:

TweakedAliasThis:
    alias StorageClassesopt Identifier this ;

Given ref and now scope will be storage classes, that would then allow just:

alias scope ref t this;


Reply via email to