Receiving (and not sending
) by const reference is purely an optimization, in order to avoid unnecessary copies. The "clean" solution is to pass by value when you don't really need the original object.
Regarding performances, references are pointers so:
- It "wastes" memory when the data size is less than pointer size
- It "wastes" CPU because you get an extra indirection
That's why it's useless for small types.