On Saturday, 18 January 2014 at 22:12:09 UTC, bearophile wrote:
Walter Bright:

I don't think a new syntax is required. We already have the template syntax:

  RangedInt!(0,10)

should do it.

Is this array literal accepted, and can D spot the out-of-range bug at compile time (Ada language allows both things)?

RangedInt!(0, 10)[] arr = [1, 5, 12, 3, 2];

Even though the syntax would be less lean, D can already to this with templates and/or CTFE quite easily.

Reply via email to