|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-10-09 09:21:29
"Dave Harris" <brangdon_at_[hidden]> wrote in message
news:memo.693391_at_cix.compulink.co.uk...
| In-Reply-To: <ck6la2$kki$1_at_[hidden]>
| nesotto_at_[hidden] (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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk