lvalue method

Simen kjaeraas simen.kjaras at gmail.com
Fri Oct 8 06:51:59 PDT 2010


Steven Schveighoffer <schveiguy at yahoo.com> wrote:

> The correct way is to use auto ref as the parameter:
>
> struct vec4
> {
>     ...
>     vec4 Normalize(auto ref const(vec4) param) {...}
> }
>
> But AFAIK, this doesn't really work.

It doesn't, no. I'm not even sure it's scheduled for inclusion.
Also, with bugzilla #4843, overloading ref/non-ref for structs don't
work, so the only current solution is to not use ref.

-- 
Simen


More information about the Digitalmars-d-learn mailing list