
"Dave Harris" <brangdon@cix.compulink.co.uk> wrote in message news:memo.693391@cix.compulink.co.uk... | In-Reply-To: <ck6la2$kki$1@sea.gmane.org> | nesotto@cs.auc.dk (Thorsten Ottosen) wrote (abridged): | > Conclusion: disallowing 0 will not only lead to simpler, safer | > programs, but it will probably also boost performance. | | The null object pattern can only be used if all the object's member | functions have trivial post-conditions. If instead I have code like: | | dog.walk_to( pTree ); | assert( dog.location() == pTree ); | // ... more code assuming the dog's location. | | then it is not going to work with a null_dog. If people use it anyway | there will be tears before bedtime. could you post your real code along with reasons for putting a null into the tree and maybe some comments about the density of null's in the tree. Thanks Thorsten