Boost logo

Boost Users :

Subject: [Boost-users] [Variant] Tree like structure with variant
From: dariomt_at_[hidden]
Date: 2010-10-21 04:39:50


Hi all,

I need a tree-like structure like the following

boost::variant< int, std::vector<tree>, std::map<std::string, tree> > tree;

So, my tree can have an int, or a list of trees, or a map of trees.

Of course this is not possible, and I've been trying to use
boost::recursive_wrapper. I have looked at the example in the documentation,
but and I'm not able to achieve what I want. My feeling is that I'm missing
an extra 'node' level somewhere, but since all the types I'm using are
typedefs, I cannot forward delcare it to break the cyclic reference...

I would appreciate help with this.
Thanks in advance.



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