As I know, perfect forwarding is design for reducing the need of
many overloaded functions when you pass the reference to the function
and pass those reference to another functions
Besides, to fullfill the objective of perfect forwarding
&& should be able to swallow the lvalue and rvalue
That means I could write something like this
void accept(int const& a, int const& b) {}
void accept(int& a, int& b) {}
void accept(int const& a, int& b) {}
void accept(int& a, int const& b) {}
void testPF(int&& a, int&& b) {}
int main()
{
testPF(2, 3);//ok
int a = 10, b = 20;
testPF(a, b);//error
}
error message
error: cannot bind 'int' lvalue to 'int&&'
my compilers : tdm gcc4.5.2
my os : windows xp sp3(32)
Thanks a lot