lucas.simon994 0 Newbie Poster

Hi, I want to construct a vector tree using the boost make_recursive_variant library. The point of desigin the tree like this is so that when I create a new node, it will be appended to some vector, which acts as a buffer, and then the myStruct_tree will contain pointers to that buffer. During deconstruction, I will not have to worry about a memory leak, which makes my life much easier. Here is the example code which demonstrates how it is implemented.

struct myStruct {
    int a;
    string b;
};

typedef boost::make_recursive_variant<
      myStruct *
    , std::vector< boost::recursive_variant_ >
    >::type myStruct_tree;

Now, how do I traverse this tree using some kind of position vector?