|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-10-11 10:33:36
Dave Harris <brangdon <at> cix.compulink.co.uk> writes:
> There is no reason to put a null in the tree. The density of nulls in the
> tree should be zero.
The code needs to be surrounded by a test, equivalent
> to:
>
> if (pDog != 0) {
> pDog->walk_to( pTree );
> assert( pDog->location() == pTree );
> // ... more code assuming the dog's location.
> }
>
> My point is that using null_object does not enable you to avoid the "if"
> statement. And further, having a walk_to() member which is valid for some
> Dog subclasses and not others, is not really an improvement.
I suspect having null is reasonable, but I explicitly requested to see the code.
Otherwise its hard to make a real jugdement.
If there is no null in the tree, then why test for it?
br
Thorsten, the confused
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk