4 ms·
> With modern C++ you can use value semantics with move semantics to get same performance as pass by reference. That's overly simplistic. To enjoy the benefits
by vinkelhake 12y ago
> With modern C++ you can use value semantics with move semantics to get same performance as pass by reference.
That's overly simplistic. To enjoy the benefits of move semantics you need something to move from. If you call for_each from the article with an lvalue, you will end up making a copy (and it'll be up to the compiler to do something about that).