K
Karl Heinz Buchegger
Karl said:You must have a compiler which is really bad at optimization.
In the following code, the timing is as follows:
operator+: 180 clock ticks
function add(): 240 clock ticks
So (thanks to the optimizer, which optimizes away the total overhead
of the temporary) the code using operator+ is actually *faster* then
your specialized function.
Oh. I forgot. This was measure with VC++ 6.0. A fairly old compiler.
If VC++ can do it, any other compiler younger then 8 years can do it
also.