Trass3r <u...@known.com> wrote:
> 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?

The difference -- you've answered yourself in the title ;).

Reason why struct literals are lvalues -- because Walter and others believe
this is valid. Check the discussion in bugzilla issues 5178 and 5889. 

BTW, C99's compound literals also give lvalues.

Reply via email to