On 03/11/2012 11:58 PM, Robert Jacques wrote:
Manu was arguing that MRV were somehow special and had mystical
optimization potential. That's simply not true.

Not exactly mystical, but it is certainly there.

void main(){
    auto a = foo(); // MRV/struct return
    bar(&a.x); // defined in a different compilation unit
}

struct return has to write out the whole struct on the stack because of layout guarantees, probably making the optimized struct return calling convention somewhat slower for this case. The same does not hold for MRV.



Reply via email to