Null references (oh no, not again!)

Christopher Wright dhasenan at gmail.com
Thu Mar 5 15:25:19 PST 2009


BCS wrote:
> Your right, but if you switch to a class and factory with no public 
> constructor, you can make it work. The problem of perf going down the 
> drain is avoidable if you can (in that mode) enforce compile time 
> checking of most cases and requiter calls to do run time checks for the 
> rest. If the template works right, than flipping back to alias/typedef 
> mode leaves the run time checks and leave the unchecked code as correct 
> while doing away with the perf problems.

If you use a class, you're begging the question. It's just that you'll 
have a null NotNull!(T) rather than a null T.

Granted, you can use opAssign(T) instead, but you still need contracts.



More information about the Digitalmars-d mailing list