On Mar 18, 2005, at 1:53 AM, S wrote:
Here is a situation where typedefs for EdgeList etc can prove to be very useful.
template < class graph_type > void foo( graph_type& g ) { // I would like to create another graph type which depends // on the value of the template parameter graph_type // e.g.
typedef adjacency_list< graph_type::EdgeList, graph_type::VertexList, undirectedS
another_graph_type; // note that graph_type could have been directedS or bidirectionalS // but I would like to ignore that when creating another_graph_type
another_graph_type ag; copy_graph( g, ag ); // and so we have an undirected version of the input graph - g }
To be really picky, since "graph_type" has to be an adjacency list
anyway, one possibility is to do this:
template
What do you think?
I had originally thought you wanted something different. I'm not at all opposed to providing these typedefs. I'm just about to check in changes that provide the typedefs out_edge_list_selector, vertex_list_selector, directed_selector, and edge_list_selector for the OutEdgeListS, VertexListS, DirectedS, and EdgeListS template parameters, respectively. Doug