how do I tell if something is lvalue?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 31 12:49:43 PST 2016


struct S
{
   int x;
   ref int y() { return x; }
   int z() { return 1; }
}

What can I use, given S, to determine that x and y yield lvalues, while 
z yields an rvalue?

I was expecting something like isLvalue somewhere, but cannot find it.

__traits(isRef, ...) doesn't work.

-Steve


More information about the Digitalmars-d-learn mailing list