Null references (oh no, not again!)

Christopher Wright dhasenan at gmail.com
Fri Mar 6 15:19:34 PST 2009


BCS wrote:
> Hello Christopher,
> 
>> 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.
>>
> 
> That won't be an issue because it's a run time concern and I am 
> proposing that the class based version never even run. In fact it could 
> even not be runable. All it does is enforce usage patterns that do work 
> correctly with a different set of definitions.

I don't understand what you are saying. If you can't run a program that 
uses NotNull, who in their right mind would use it?



More information about the Digitalmars-d mailing list