About ref used for performance reasons with struct

Namespace rswhite4 at googlemail.com
Tue Feb 12 07:53:56 PST 2013


Don't get me wrong, I also hope that this unfortunate and lengthy 
discussion ends. And I also like the idea that const ref works as 
in C++.
But I'm sure you can convince neither Walter nor Andrei still the 
core developer team.

And I don't quite understand what speaks against my suggestion.
If the compiler decides that by value is a better solution, then 
structs are received by value, otherwise by ref. But the user 
don't need to worry about it, because, whatever the compiler may 
decide to do, he adapt calls to these functions automatically. It 
is in principle nothing more than what you want.


More information about the Digitalmars-d mailing list