<div dir="ltr">adding an overload would increases likelihood for bugs but could be possible. The same holds for getopt. <div><br></div><div>Another question:</div><div>the documentation for formattedRead is quite sparse, how does it explain the following behavior:</div>
<div><br></div><div><div> string s="a1 a2 a3";</div><div> string a,b;</div><div> uint n=formattedRead(s,"%s %s",&a,&b);</div><div> assert(a=="a1" && b=="a2 a3");</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 20, 2013 at 10:44 PM, Dmitry Olshansky <span dir="ltr"><<a href="mailto:dmitry.olsh@gmail.com" target="_blank">dmitry.olsh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">21-May-2013 01:39, Timothee Cour пишет:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That was indeed what I was using in my updated ref based<br>
reimplementation of formattedRead (see my original post for the link),<br>
and the other functions getopt, readf) are the same AFAIK.<br>
<br>
so why not add it to phobos:<br>
it's safer (no null / invalid pointers)<br>
simpler user code<br>
more consistent with rest of phobos<br>
<br>
we could either make the existing by pointer functions enter a<br>
deprecation path, or add a 'formattedReadRef' version for all those<br>
functions.<br>
<br>
Thoughts?<br>
</blockquote>
<br></div>
You can just add an overload I bet. Since you can't read a pointer and &x is an r-value and (thank god) there wasn't decision to allow r-value as plain ref.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Dmitry Olshansky<br>
</font></span></blockquote></div><br></div>