Would it be much easier to implement the boost graph lib if C++ containers could reference themselves? I mean if something like std::list_traits<T> was available so that the iterator class could be got without instantiating the actual list. Simplistically, some thing like... struct vertex; struct edge; typedef std::list_traits<vertex>::iterator Vit; typedef std::list_traits<edge>::iterator Eit; struct edge { Vit source; Vit target; }; struct vertex { std::list<Eit> edges; }; I'm asking because container traits seem to be useful in the work I do, so I'm trying to garner support for them. Thanks, Louis.
On Aug 15, 2006, at 10:51 PM, Louis Lavery wrote:
Would it be much easier to implement the boost graph lib if C++ containers could reference themselves?
There are some places where we've needed to introduce container traits. For instance, see the adjacency_list_traits template. It's possible that container traits would allow us to replace the "void*" vertex descriptors (and all of the evil casting that implies) with actual, typed descriptors. Doug
participants (2)
-
Douglas Gregor
-
Louis Lavery