<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 19 October 2016 at 03:51, Jonathan M Davis via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tuesday, October 18, 2016 13:36:42 Namespace via Digitalmars-d wrote:<br>
> On Tuesday, 18 October 2016 at 09:50:35 UTC, ketmar wrote:<br>
> > On Tuesday, 18 October 2016 at 06:30:15 UTC, Namespace wrote:<br>
> >> On Tuesday, 18 October 2016 at 02:54:08 UTC, Manu wrote:<br>
> >>> I just want to be able to pass an rvalue to a function that<br>
> >>> receives a<br>
> >>> const ref... that's why I came to this forum in the first<br>
> >>> place like,<br>
> >>> 7 years ago. 7 years later... still can't.<br>
> >><br>
> >> I recently wrote a PR for p0nce D idioms, which shows how you<br>
> >> can do that<br>
> >> <a href="https://github.com/p0nce/d-idioms/pull/119" rel="noreferrer" target="_blank">https://github.com/p0nce/d-<wbr>idioms/pull/119</a><br>
> ><br>
> > there is a huge difference between "i can hack around it" and<br>
> > "i can do it".<br>
><br>
> True. ;) It's like the static-array-without-length-<wbr>and-gc hack.<br>
> You can do it with language constructs but it's inconvenient. So<br>
> it's up to Walter and Andrei to decide if this inconvenience is<br>
> bearable or not.<br>
<br>
</div></div>Andrei decided ages ago that he didn't think that having const ref take<br>
rvalues was a good idea and that he doesn't think that it's a big deal. I<br>
don't recall whether Walter has said much on the issue, but AFAIK, he hasn't<br>
said anything to contradict that, and Andrei has been very vocal about how<br>
rvalue references were a horrible mistake in C++ and that he doesn't want to<br>
see anything of the sort in D.</blockquote><div><br></div><div>Don't misunderstand, at no point I'm aware has anyone ever talked about rval references.</div><div>This is all about passing rvalues as normal references.</div><div><br></div><div>People just want to be able to do this:</div><div><br></div><div>  void f(ref const(Vector) v);</div><div><br></div><div>  f(v1 + v2);</div><div><br></div><div>or:</div><div><br></div><div>  f(Vector(10,20,30));</div><div><br></div><div>That is all. The rval produces a temporary, and the temporary is passed to the function.</div></div></div></div>