Why definition of std::function<>::operator() in the C++ standard is:
R operator()(ArgTypes...) const;
and not
R operator()(ArgTypes&&...) const;
?
One would think that to correctly forward parameters, we need the && and then use std::forward<ArgTypes>...
in the function body when forwarding the call?
I partially reimplemented std::function to test this and I found out that if I use the &&, I get "cannot bind 'xxx' lvalue to 'xxx&&'" from g++ when I try later to pass parameters by value to operator(). I thought that I got enough grasp of the rvalue/forwarding concepts, but still I cannot grok this point. What am I missing?