[Issue 17190] [REG2.072] isNumeric!string conflict std.traits std.string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 27 12:45:22 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17190

b2.temp at gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #2 from b2.temp at gmx.com ---
option 1/ 

Renaming with deprecation is not like breaking:

bool isNumber(S)(S s, bool bAllowSep = false) {}
deprecated("use isNumber instead, ...") alias isNumeric = isNumber;


option 2/ 

there's a simple fix, but it's not particularly nice:

bool isNumeric(S, T = void)(S s){return false;}
enum isNumeric(S) = true;
static assert(isNumeric!string);
static assert(!isNumeric("sdf"));

--


More information about the Digitalmars-d-bugs mailing list