minus-squareHal_Canary@lemmy.sdf.orgtoProgrammer Humor@lemmy.ml•Worse than single letterslinkfedilinkEnglisharrow-up5·1 year agoI came here to say this. Declare result in the first line of the function and return result is the last line. In C++, this is a big hint to the compiler that you want return value optimization to kick in. linkfedilink
minus-squareHal_Canary@lemmy.sdf.orgtoProgrammer Humor@lemmy.ml•FizzBuzz: Enterprise EditionlinkfedilinkEnglisharrow-up1·1 year agoThis makes me cry. linkfedilink
I came here to say this.
Declare
result
in the first line of the function andreturn result
is the last line. In C++, this is a big hint to the compiler that you want return value optimization to kick in.