I\'ve coded the following example in order to better illustrate my questions.
In the code below, I introduce a function object (i.e., funObj
The move semantics introduced in C++11 exist to largely alleviate this set of 'unnecessary' copies. If you define a move constructor
for your function-objects the STL will move
the function-object (even/especially if it is a temporary) which will prevent the copy from occurring. This will allow you to use the STL algorithms with value-semantics without sacrificing too much in the way of performance. It will also allow you to use temporary function-objects as desired.