Re: Checked!({short, ushort, byte, char}, Throw): compilation fails

2020-04-16 Thread Meta via Digitalmars-d-learn
Unlike C/C++, char is not a numeric type in D; It's a UTF-8 code point: import std.traits; void main() { pragma(msg, isNumeric!char); //Prints false }

Checked!({short, ushort, byte, char}, Throw): compilation fails

2020-04-16 Thread kdevel via Digitalmars-d-learn
Sorry for this lengthy post: ```x.d void foo (T) () { import std.experimental.checkedint; alias CT = Checked!(T, Throw); CT a = CT.min; CT x; --x; CT b = x; CT c = a / b; } void bar (T) () { import std.stdio; try foo!T (); catch (Exception e) writefln ("caught