About structs and performant handling

Namespace rswhite4 at googlemail.com
Tue Mar 12 08:19:13 PDT 2013


> Here is what I think. How the thing is actually passed don't 
> matter. What does matter is that the semantic is know : ie that 
> the program will behave in a known way.
I agree.

> As a consequence, if the compiler choose to pass by ref instead 
> of passing by value as an optimization, it must do so only if 
> it can prove that the resulting code will do the same thing.
And how could it be proved? IMO with const (not mutable) scope 
(no escaping). What are your thoughts?


More information about the Digitalmars-d mailing list