
Hello, everyone: I want write a general linked list(any element in the list may be a node or nested general linked list, so recursive). I think general linked list could by defined as following(see spirit's tutorial mini_xml): glist = *glist_node glist_node = node | glist so here is the typedef according to the above rules: struct node { int data; }; typedef boost::variant<node, boost::recursive_wrapper<glist> > glist_node; //typedef 1 typedef std::list<glist_node> glist; //typedef 2 so the problem comes here, in the typedef 1, how can I forward declare glist? I know this is not a problem if I define glist as a struct or class, but I think the all-powerful library must has a beautiful solution, if any one has a solution, please let me know.