nothrow function to tell if a string can be converted to a number?
H. S. Teoh
hsteoh at quickfur.ath.cx
Wed Sep 11 16:03:40 PDT 2013
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
More information about the Digitalmars-d-learn
mailing list