string s = "whatever"; //maybe in a loop s = modify(s);
Then it looks like a function
string modify (string) is always outperformed by a function like
modifyInPlace(string &). Is there any way around this problem? Is there any fundamental reason why this can never be solved? I think the semantics of take by value, return by value are safer and clearer.
Example comparison measurement: http://quick-bench.com/-XZqOZw-X739tlcOI8vau8DU24w