
28 Sep
2007
28 Sep
'07
2:33 a.m.
"Peng Yu"
f1(i,d); // #1 tie(i,d) = f2(); // #2 ///////////////////
What about the current commonly used compiler, such as GCC? Are #1 and #2 different in GCC?
Does the compiler always have some way to optimize #2 to make it as good as #1? Is it just a matter of fact whether the optimization method is implemented?
I just tried it with gcc 4.2.1, and the tuple verison (#2) generates (slightly) better code (because in the case of #2, it only has to push one address to specify the "return location", instead of two separate addresses required by #1). -Miles -- Do not taunt Happy Fun Ball.