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
<kozz...@gmail.com> 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