Non-null objects, the Null Object pattern, and T.init

bearophile bearophileHUGS at lycos.com
Sat Jan 18 14:12:07 PST 2014


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];

Probably there are other semantic details that should be handled.

Bye,
bearophile


More information about the Digitalmars-d mailing list