3 ms·
Most importantly, programmers of the 2020's shouldn't be making these decisions. Wether you choose to pass by reference or copy, that should just indicate your
by londons_explore 7y ago
Most importantly, programmers of the 2020's shouldn't be making these decisions.
Wether you choose to pass by reference or copy, that should just indicate your desired semantics. The underlying compiler can decide if it's really worth making a copy or not.
Sadly most compilers won't elide out most unnecessary copy operations, even when performance would be improved to do so.