Boost logo

Boost :

From: Dave Harris (brangdon_at_[hidden])
Date: 2004-10-12 06:13:56

In-Reply-To: <loom.20041011T172801-139_at_[hidden]>
nesotto_at_[hidden] (Thorsten Ottosen) wrote (abridged):
> If there is no null in the tree, then why test for it?

The test is to prevent moving a null dog to the tree.

> I suspect having null is reasonable, but I explicitly requested to see
> the code.

There is no real code; the example was invented to illustrate the
importance of post-conditions. Which is another way of putting what it
says in the .pdf file you referenced: the Null Object pattern is not
universally applicable. The point is general and not about the specific
code. Are you claiming that Null Object is, in fact, applicable in every
situation? If not, just imagine I picked an example where you agree its
not applicable. If, on the other hand, you believe no such example is
possible, then you surprise me.

Regardless I don't think further discussion is appropriate here, because
it is not crucial to the Smart Container proposal. As I said in my
original message:

   ... this is no more an argument against ptr_vector<Dog> than it
   is against std::vector<Dog>.

In saying that I was supporting your proposed library. Given that
ptr_vector<T> behaves more like vector<T> than vector<T*>, the restriction
on NULLs is logical and reasonable.

-- Dave Harris, Nottingham, UK

Boost list run by bdawes at, gregod at, cpdaniel at, john at