[Issue 5889] Struct literal/construction should be rvalue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 29 17:52:13 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5889


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #5 from Don <clugdbug at yahoo.com.au> 2011-06-29 17:47:15 PDT ---
I'm not convinced about this bug. Why do you think that struct literals should
become rvalues (rather than non-modifiable lvalues)? It's a breaking change.

You've mentioned opEquals, but it's much broader than that. Fairly obviously it
also affects opCmp, but in fact, any function which takes a struct by const ref
will currently accept a struct literal.

Also, what about member functions? 'this' is passed by reference, yet you can
use CTFE on member functions of struct literals.

It's clearly a bug to allow a struct literal to be passed by non-const
reference, but as to making them rvalues, I'm not sure. This needs confirmation
from Walter.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list