News for hackers. Stuff that matters.
Re:Perfect forwarding and universal references in C++ by monk_the_dog on Monday November 10, 2014 @02:04PM (#8585519)
Maybe you're confusing reference collapsing with universal references?

In your example, replace bar<int&&>(6) to bar<int&&>(i).

It won't compile because i is not an r value. bar(i) will compile, because the template parameter is a universal reverence that will become an lvalue (not an rvalue) through reference collapsing.

Re:Perfect forwarding and universal references in C++ by splinterofchaos on Monday November 10, 2014 @02:41PM (#8585746)
I called "bar" with "<int&&>" to demonstrate that you can bind an rvalue-ref to an rvalue-ref, not to suggest that's how it should be called.