nothrow function to tell if a string can be converted to a number?

Timothee Cour thelastmammoth at gmail.com
Wed Sep 11 20:15:26 PDT 2013


anyways, isNumeric sounds buggy, isn't it?


On Wed, Sep 11, 2013 at 4:03 PM, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:

> On Wed, Sep 11, 2013 at 02:10:32PM -0700, Timothee Cour wrote:
> > actually that doesn't work:
> >
> > assert(!isNumeric(`j`)); //ok
> > assert(!isNumeric(`i`)); //fails ; i is treated as a complex number but
> > that's not good behavior as we can't write auto a=i;
>
> Yikes!
>
> This makes me *extremely* glad built-in complex numbers are
> deprecated... can you imagine the mess that would result if you had a
> loop counter named 'i' and the loop body contains expressions involving
> 'i' and complex literals involving (the other) 'i'?
>
> *shudder*
>
>
> T
>
> --
> GEEK = Gatherer of Extremely Enlightening Knowledge
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20130911/63b6fa4a/attachment.html>


More information about the Digitalmars-d-learn mailing list