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

bearophile bearophileHUGS at lycos.com
Sat Jan 18 14:19:09 PST 2014


Michel Fortin:

> In fact, even the most obvious case can't be caught at 
> compile-time with the template approach:
>
> 	void baz()
> 	{
> 		foo(999); // runtime error here
> 	}

The constructor of the ranged int needs an "enum precondition":

http://forum.dlang.org/thread/ksfwgjqewmsxsribenzq@forum.dlang.org

Bye,
bearophile


More information about the Digitalmars-d mailing list