Why do struct literals count as lvalues?

Trass3r un at known.com
Thu Aug 18 12:33:29 PDT 2011


struct A {}
static A bar()
{
     return A();
}
void foo(ref A a) {}
void main()
{
     foo(A());   // works
     foo(bar()); // doesn't
}

Where's the difference?


More information about the Digitalmars-d mailing list