If you need a local object, then passing by value is best. This enables move semantics, if the argument is a temporary or explicitly moved, so that unnecessary copying can be avoided.
Passing by reference forces a copy whether it's needed or not. If the reference isn't const
, then the argument can't be a temporary. Accepting a const
object by value and then copying it is just weird.
(Note that, in your specific examples, you don't need a local copy, just the result of applying an operator to the argument; so a const
reference might be more appropriate.)