Boost logo

Geometry :

Subject: [ggl] spacial index construction interface
From: Bruno Lalande (bruno.lalande)
Date: 2011-03-10 04:56:48


So probably the key is first to avoid those shared pointers. That can be
> done by using one of the designs Adam and Bruno pointed out, specificly
> option 3 from Adam ("No virtuals. Unused data"), also favoured by Bruno (if
> I'm right).

To be precise: I favour this solution (option 3) BUT doubt it's feasible.

To summarize:
* If there is absolutely nothing a leaf can do and not a node, and the other
way around then:
   * We can go for option 3, only one class, no polymorphism.
   * And then we no longer need to store pointers. We can have a vector of
* Otherwise:
   * We have to go for option 1 (classic polymorphism).
   * In which case we should go by-the-book and use visitors to operate on
the tree.
   * And we definitely have to use pointers, whichever way.

So the question is: is there anything in a leaf that's not in a node? For
instance, can both a node and a leaf store values? Or is it just leaves?

One idea, although it's more work: I was wondering if we couldn't implement
both, and then test them on a few complicated cases to see what it gives in
terms of performance and memory. Would be very instructive, I think.

-------------- next part --------------
An HTML attachment was scrubbed...

Geometry list run by mateusz at