std.conv length=0

Derek Parnell derek at nomail.afraid.org
Tue Apr 10 00:31:56 PDT 2007


Currently, the functions in std.conv throw an exception if the input string
is empty. What is the rationale for this? 

I find myself writing shims like ...

 int makeInt(char[] d)
 {
    if (d.length == 0) return toInt("0");
    return toInt(d);
 }

Is there anyone here that relies on an empty string throwing a conversion
error?

Also, I see that there is no link back to the DWiki/DocComments in the
std.conv docs.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
10/04/2007 5:27:01 PM


More information about the Digitalmars-d-learn mailing list