A
alex221
In need to implement a tree structure in which every node has arbitrary
number of children the following code has come into mind:
using std::list;
template < class Contents > class Tree_node{
Contents cn;
list < BTree_node < Contents > > children;
........
}
template < class Contents > class Tree{
list < Tree_node < Contents > > ;
........
}
on what microsoft VC++ compiler complains with error message
error C2079: 'child_list' uses undefined class 'list<class
BTree_node<int>,class std::allocator<class BTree_node<int> > >'
when trying to instantiate
Tree <int> tree;
What is the workaround for this?
Thanks in advance
number of children the following code has come into mind:
using std::list;
template < class Contents > class Tree_node{
Contents cn;
list < BTree_node < Contents > > children;
........
}
template < class Contents > class Tree{
list < Tree_node < Contents > > ;
........
}
on what microsoft VC++ compiler complains with error message
error C2079: 'child_list' uses undefined class 'list<class
BTree_node<int>,class std::allocator<class BTree_node<int> > >'
when trying to instantiate
Tree <int> tree;
What is the workaround for this?
Thanks in advance