The way I like to think about this is along these lines: func(const vector& blub) means 'I use blub, will not change it and you - the caller - retain ownership'. If I (the function) require 'blub' for longer, I need to make a copy.
func(vector blub) means 'I require my own blub. If you do not need yours anymore, use std::move() and I will use it. Otherwise calling me will copy blub.' But I find the design choices when to use a per-value and when to use a const ref& not always easy. Generally you could say that if a function copies a value ever, using a per-value argument is preferable. -- https://code.launchpad.net/~widelands-dev/widelands/bug-986611-cppcheck_performance-ui/+merge/300992 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-986611-cppcheck_performance-ui. _______________________________________________ Mailing list: https://launchpad.net/~widelands-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp

