pass variable names

Saaa empty at needmail.com
Thu Jul 9 21:58:45 PDT 2009


> No.
>
> You should be able to get the name using an alias:
>
> void func(alias var)()
> {
>    writefln(var.stringof);
> }
Can this be combined with the tuple parameter?

>
> But you can't do it at runtime.
>
>> Also how do I fix this:
>> --
>> functio(`i`); // Error: "i" is not an lvalue
>
> You have to store the literal in a variable.
I needed it to get my function to accept
func( `name_i`, i, `name_ar`, ar, `name_b`, b ..etc..)
only the variables need to be ref. 




More information about the Digitalmars-d-learn mailing list