this is not an lvalue

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 15 07:35:22 PST 2016


On Thursday, 15 December 2016 at 14:05:08 UTC, Andrey wrote:
> In D, probably, I could write something like this:
>> void open(in string fileName) {...}

Yes, though remember that `in` does have a specific meaning (even 
though the compiler rarely enforces it): it means you promise not 
to modify it nor keep a reference to it.

So don't use `in` on anything you want to keep as a member or 
global variable, it is something you will just look at inside 
this function then let go.


More information about the Digitalmars-d-learn mailing list