Boost logo

Boost Users :

From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2007-07-10 02:22:06


valentin julien <julien.valentin <at> cstb.fr> writes:
> Hello,
> I don't know what has become to the rest of my post:
> My question was about the integration of a dimension template binary
> tree in boost.I'm working on such a thing and I think that kind of
> dichotomic data structure would be very usefull for various use...
> The other question I have is how could I do to make genericity on
> contained types without use a dynamic_cast at runtime:
> my prototype for the moment look like this
>
> template <int Dimension,typename T> MultiDimensionalBinaryTree;
> template <typename T> typedef MultiDimensionalBinaryTree<2,T> QuadTree;
> template <typename T> typedef MultiDimensionalBinaryTree<3,T> OctreeTree;
> ...
>
> *template<typename T>* typedef MultiDimensionalBinaryTree<2, *T*≥ Registry;

Do as STL does -- stick to homogenous container and let user decide what she
wants to put in it. If one wants heterogeneous tree, then she can use
MultiDimensionalBinaryTree<N, boost::any> or MultiDimensionalBinaryTree<N,
boost::variant<...> >.

Roman Perepelitsa.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net