DConf Day 1 Panel with Walter Bright and Andrei Alexandrescu

safety0ff via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Jun 27 16:30:38 PDT 2014


I have two questions that I've come upon lately:

1) How was it decided that there should be implicit conversion 
between signed and unsigned integers in arithmetic operations, 
and why prefer unsigned numbers?
E.g. Signed / Unsigned = Unsigned
Is this simply compatibility with C or is there something greater 
behind this decision.

2) With regard to reducing template instantiations:
I've been using a technique similar to the one mentioned in the 
video: separating functions out of templates to reduce bloat.
My question is: does a template such as:
T foo(T)(T x)
if (isIntegral!T) { return x; }

Get instantiated multiple times for const, immutable, etc. 
qualifiers on the input?


More information about the Digitalmars-d-announce mailing list