auto ref
Walter Bright
newshound1 at digitalmars.com
Tue Dec 15 23:41:06 PST 2009
Mikhail Dahl wrote:
> Just to confirm (I'm just getting into D, so I don't know much about the
> language, still learning), but the idea is to apply 'auto' not only to
> types but also to storage classes? As in 'automatically apply ref in the
> case of lvalue'?
Yes, exactly.
> If so I'm a little confused by 'auto ref foo(...' - if auto ref here is
> also simply an 'apply ref in the case of lvalue', then where is the
> return type being inferred from?
From the return statement in the body of the function.
More information about the Digitalmars-d
mailing list