I've come from C++ world with such things like the move semantic and RVO. Since that, I wonder are there any trade-offs when you pass arguments by value?
In my case, I have pretty big structs that I need to pass to a bunch of functions. As I have understood, every time I pass a value to a function, a copy will be created. Would it be better to pass pointers instead of values?
I see the only trade-offs that the original object could be changed accidentally or ignorantly, and it is unclear for a caller that a passed argument is not supposed to be modified.
Is there an optimization if a passed value has not been modified?