> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Philippe A. Bouchard > Sent: Monday, July 28, 2003 6:08 AM > To: [EMAIL PROTECTED] > Subject: [boost] Re: Re: GUI/GDI template library >
[...] > By the way, this should be defined in the Boost Library: > > template <typename T> > struct tree > { > list<T> element; > list<tree> children; > }; > > You get the idea that you have more control of how you wish to represent > you > container data & individual entries this way. If you want to (and you will) you can go crazy with the static types of the tree nodes. I'd recommend using some sort of mpl type list to define the structure of the tree and callbacks to generate the actual nodes at runtime - you don't necessarily want to have to generate them all at once. I've got a tree built on top of the windows tree control that takes a type tree to specify its layout. You also need to be able to specify recursive tree structures statically since things like paths may be arbitrarily deep. You can access children by specifying the values of its parent nodes (assuming everything is less-than-comparable). All of the access functions can be generated as part of the compile time structure of the tree. If this doesn't make sense I can dig up some sample code. It wasn't pleasant but I got it to work under VC 6. Brock Peabody _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost