Re:Functional Programming in C++
by vinkelhake on Sunday November 16, 2014 @03:40PM
(#8615354)
> 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).
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).