Spec#, nullables and more

bearophile bearophileHUGS at lycos.com
Sat Nov 6 02:40:15 PDT 2010


Simen kjaeraas:

> Bounded!(int, 1, 5)[] myArr;
> myArr ~= 1; // Compile-time error: int is not implicitly castable to  
> Bounded!(int, 1, 5)
> myArr ~= Bounded!(int, 1, 5)( 1 ); // Works perfectly

I can't say this is a nice syntax :-)
(Isn't the implicit conversion + bound test better?)

Bye,
bearophile


More information about the Digitalmars-d mailing list