<div dir="ltr">But maybe you can propose cjange from ref R r to auto ref R r<div><br></div><div><a href="https://dlang.org/spec/template.html#auto-ref-parameters">https://dlang.org/spec/template.html#auto-ref-parameters</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 29, 2017 at 8:50 AM, Daniel Kozak <span dir="ltr"><<a href="mailto:kozzi11@gmail.com" target="_blank">kozzi11@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">No it is not a bug, because <span class=""><div><span style="font-size:12.8px"> uint formattedRead(alias fmt, R, S...)(ref R r, auto ref S args)</span><br></div></span><div><span style="font-size:12.8px">could not match (there is a ref R r) so in your first example you dont have lvalue but rvalue</span></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 29, 2017 at 8:30 AM, IM 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">The following code:<br>
<br>
  int guess;<br>
  readln().formattedRead!"%d"(gu<wbr>ess);<br>
<br>
produces the following compiler error:<br>
<br>
Error: template std.format.formattedRead cannot deduce function from argument types !("%s")(string, int), candidates are:<br>
/usr/include/dmd/phobos/std/fo<wbr>rmat.d(635):        std.format.formattedRead(alias fmt, R, S...)(ref R r, auto ref S args) if (isSomeString!(typeof(fmt)))<br>
/usr/include/dmd/phobos/std/fo<wbr>rmat.d(644):        std.format.formattedRead(R, Char, S...)(ref R r, const(Char)[] fmt, auto ref S args)<br>
<br>
That is odd! I expected this to match:<br>
<br>
  uint formattedRead(alias fmt, R, S...)(ref R r, auto ref S args)<br>
<br>
However, the following works!!!<br>
<br>
  int guess;<br>
  string line = readln();<br>
  line.formattedRead!"%d"(guess)<wbr>;<br>
<br>
<br>
This definitely looks like a bug, but I want to confirm first before filing one.<br>
<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>