So what does (inout int = 0) do?

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 14 23:15:16 PDT 2016


On Friday, 15 April 2016 at 05:38:56 UTC, Andrei Alexandrescu 
wrote:
> I think we should deprecate inout. For real. It costs way too 
> much for what it does. For all I can tell most of D's 
> proponents don't know how it works. -- Andrei

What would replace it in the case of classes, where you can't 
have templated virtual methods? Perhaps a mechanism to declare a 
templated virtual function, and a list of instantiations which 
will go into the vtable?

If we are to kill inout and replace it with something else, then 
it should support cases where inout failed, such as inout on the 
parameter of a delegate passed to the function (see: inout 
opApply).


More information about the Digitalmars-d mailing list