Null references (oh no, not again!)
BCS
none at anon.com
Fri Mar 6 09:46:32 PST 2009
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.
More information about the Digitalmars-d
mailing list