Ref (was Re: inlining)

superdan super at dan.org
Fri Jul 18 07:42:23 PDT 2008


Matti Niemenmaa Wrote:

> Walter Bright wrote:
> > I don't see the need for an inline or non-inline specifier. It's as 
> > obsolete as the register keyword.
> 
> Then why was "inout" renamed to "ref"?
> 
> Before you say, "so that we could have 'const ref'", let me note that ref in 
> that sense is as obsolete as inline or register. It should just be "in" or the 
> default and the compiler should figure out whether it's by-reference or by-value.

how is that even close to making sense? 

before you say, "but value vs. 'in' is entirely transparent to the user", let me note that aliasing is going to fuck that plan right there.

deciding value vs. reference only works for invariant shit. it's in fact part of why invariant shit is so fucking brilliant.



More information about the Digitalmars-d mailing list