On 18.10.2016 20:15, ag0aep6g wrote:
On 10/18/2016 07:51 PM, Jonathan M Davis via Digitalmars-d wrote:
Andrei decided ages ago that he didn't think that having const ref take
rvalues was a good idea and that he doesn't think that it's a big deal. I
don't recall whether Walter has said much on the issue, but AFAIK, he
said anything to contradict that, and Andrei has been very vocal about
rvalue references were a horrible mistake in C++ and that he doesn't
see anything of the sort in D.
It would be great if we had detailed rationale articles for these
First, so that people get a nice prepared answer for why D is different.
It wouldn't even be the same thing if it was allowed. D const is not C++
const. Enforcing transitive read-only on rvalue references does not make
that much sense.
If rvalues shouldn't be allowed to bind to ref alone, there should just
be some additional annotation that allows rvalues to bind to ref, but
that additional annotation shouldn't do anything more.