Many people do not know that const rvalue links are part of C ++ 11. This blog post discusses them, but seems to be mistaken for binding rules. Blog citation:
struct s {}; void f ( s&);
Note the asymmetry: while a const lvalue reference can bind to an rvalue, a const rvalue reference cannot bind to an lvalue. In particular, this makes the link const lvalue capable of making all the link to the constant rvalue can and more (i.e. communicate with lvalues).
The comments on the sample code seem to check my installation of GCC 4.9 (with the -std = C ++ 14 flag set). So, unlike the blog text, is it true that const && should bind to const & and const && and const & only to const & ? If not what is the actual rule?
Here is a demo that seems to show the binding of const && to const& in GCC 4.9: http://coliru.stacked-crooked.com/a/794bbb911d00596e
source share