On Friday, 29 December 2017 at 08:02:36 UTC, IM wrote:
On Friday, 29 December 2017 at 07:55:08 UTC, Daniel Kozak wrote:
But maybe you can propose cjange from ref R r to auto ref R r


If this will make it work with both lvalues and rvalues, then yes, this would be a nice fix. No need to force users to cache string line = readln(); first and then use it with formattedRead().

https://dlang.org/spec/template.html#auto-ref-parameters

On Fri, Dec 29, 2017 at 8:50 AM, Daniel Kozak <[email protected]> wrote:

No it is not a bug, because
uint formattedRead(alias fmt, R, S...)(ref R r, auto ref S args) could not match (there is a ref R r) so in your first example you dont
have lvalue but rvalue

https://github.com/dlang/phobos/pull/5971

Reply via email to