6 // empty parameter class with a minimal set of operations
7 // if there are no weights for edges necessary
12 bool operator<(const Empty&) const { return true;}
14 inline ostream& operator<<(ostream& os, const Empty&) { return os;}
15 inline istream& operator>>(istream& is, Empty& ) { return is;}
18 template<class VertexType, class EdgeType>
22 // public type interface
23 typedef map<int, EdgeType > Successor;
24 typedef pair<VertexType, Successor> vertex;
25 typedef vector<vertex> GraphType;
26 typedef typename GraphType::iterator iterator;
27 typedef typename GraphType::const_iterator const_iterator;
29 // a lot of stuff deleted ....
33 GraphType C; // container
37 // all graph-methods delet
38 template<class VertexType, class EdgeType>
39 ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
41 // display of vertices with successors
42 for(int i = 0; i < G.size(); ++i) // ERROR - no size function
44 os << G[i].first << " <"; // ERROR - no index operator
46 // The compiler does not like this line!!!!!!
47 typename Graph<VertexType, EdgeType>::Successor::iterator
48 startN = G[i].second.begin(), // ERROR - no index operator
49 endN = G[i].second.end(); // ERROR - no index operator
53 os << G[(*startN).first].first << ' ' // vertex
54 << (*startN).second << ' '; // ERROR - no index operator
64 // no edge weighting, therefore type Empty:
65 Graph<string, Empty> V(true); // ERROR - no bool constructor
66 // ReadGraph(V, "gra1.dat");
68 // display of vertices with successors