Does D really need something like const&?

Namespace rswhite4 at googlemail.com
Sat Mar 2 00:56:03 PST 2013


On Saturday, 2 March 2013 at 00:49:55 UTC, Era Scarecrow wrote:
> If 'auto ref' gets accepted for non-template functions, it goes 
> away. With M as you show, returning ref doesn't work so that 
> example I was going to suggest doesn't work.

auto ref will in all probability never work for non-template 
functions, as I said before.

Steven Schveighoffer:
I understand, that you like to have rvalue references for structs 
but I still don't understand why.
Despite yesterday's discussion, I still do not understand the 
reason to use a struct instead of a class, when it comes to a 
massive amount of data.
structs are copied or moved, structs have no polymorphism and no 
interfaces, so why you should use a struct instead of a class, if 
your struct is very massive? I don't get it.


More information about the Digitalmars-d mailing list