Taking the address of an rvalue struct

dsimcha dsimcha at yahoo.com
Fri Jul 22 10:10:42 PDT 2011


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
> This has long been a feature that I attempted to remove several times.

What?  Taking the address of this?  Invoking methods on rvalue structs?

> It steps from the fact that you can invoke methods on rvalue structs.
> Disallowing that would solve the issue, but would also eliminate a lot
> of convenience.

I think invoking methods on rvalue structs needs to be allowed come Hell or high
water.  What's wrong with just banning any optimization of rvalue structs that
have methods called on them, i.e. requiring the compiler to treat them the same as
named methods, allocate stack space for them that doesn't get reused elsewhere in
the same function, etc.?



More information about the Digitalmars-d mailing list