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

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Sun Jan 19 13:41:20 PST 2014


On Friday, 17 January 2014 at 05:30:45 UTC, H. S. Teoh wrote:
> Now, if we modify this sentinel to instead record the location 
> of the
> code that first initialized it (via __FILE__ and __LINE__ 
> default
> parameters perhaps), then we can set it up to print out this 
> information
> at a convenient juncture, so that the source of the 
> uninitialized
> reference can be determined. *Then* perhaps it will be a start 
> of a

Which is easy to do (in theory). Page zero is over a thousand 
unique adresses. All you have to do is to convert null-tests to a 
range test. E.g. (addr&MASK)==0



More information about the Digitalmars-d mailing list