From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2008-05-22 15:49:41
John Moeller wrote:
>One more thing. The argument is passed by value, which is ok for
>Will all those potentially excess temporaries be an issue for larger
>Perhaps the argument type of result() should be wrapped so that it's a
>reference if it's larger than a pointer.
It may be best to simply pass all arguments types by const reference in
this instance. When instantiated then inlined the function call
overhead related to making temp-copy of the argument doesn't need to be
stripped away by the compiler during subsequent optimization, which can
make it easier for the compiler to identify that it is a good idea to
inline the function in the first place. There is no real draw back to
passing a built in type by const reference, particularly if your
intention is for the compiler to inline the function anyway.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk