It used to be valid C ++ to bind a link to a temporary one, so that you could go through, for example. double functions expecting int& , as described in Design and evolution of C ++ ยง3.7:
I made one serious mistake, however, by allowing the link to be initialized not const non-lvalue. [...]
The reason that links must be initialized with non-lvalues โโwas to allow the difference between a call by value and a call by link to be a part specified by the called function, and is not of interest to the caller. For const links, this is possible; for const links, this is not. For version 2.0, the C ++ definition has been changed to reflect this.
In C ++ 2.0 (and in ISO C ++), temporary links can only be bound to const links.
source share