9 // empty parameter class with a minimal set of operations
10 // if there are no weights for edges necessary
15 bool operator<(const Empty&) const { return true;}
17 inline ostream& operator<<(ostream& os, const Empty&) { return os;}
18 inline istream& operator>>(istream& is, Empty& ) { return is;}
21 template<class VertexType, class EdgeType>
22 class Graph // { dg-message "note" } candidates
25 // public type interface
26 typedef std::map<int, EdgeType > Successor;
27 typedef std::pair<VertexType, Successor> vertex;
28 typedef std::vector<vertex> GraphType;
29 typedef typename GraphType::iterator iterator;
30 typedef typename GraphType::const_iterator const_iterator;
32 // a lot of stuff deleted ....
36 GraphType C; // container
40 // all graph-methods delet
41 template<class VertexType, class EdgeType>
42 ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
44 // display of vertices with successors
45 for(int i = 0; i < G.size(); ++i) // { dg-error "no member" } no size function
47 os << G[i].first << " <"; // { dg-error "14:no match" } no index operator
49 // The compiler does not like this line!!!!!!
50 typename Graph<VertexType, EdgeType>::Successor::iterator
51 startN = G[i].second.begin(), // { dg-error "14:no match" } no index operator
52 endN = G[i].second.end(); // { dg-error "14:no match" } no index operator
56 os << G[(*startN).first].first << ' ' // { dg-error "20:no match" } no index operator
57 << (*startN).second << ' ';
67 // no edge weighting, therefore type Empty:
68 Graph<std::string, Empty> V(true); // { dg-error "no match" } no bool constructor
69 // ReadGraph(V, "gra1.dat");
71 // display of vertices with successors