This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
eb109
- To: egcs-patches at cygnus dot com
- Subject: eb109
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 2 Jun 1998 10:04:24 +0200
This is incomplete code, so g++ reports various errors.
Martin
Index: eb109.C
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C,v
retrieving revision 1.1
diff -c -p -r1.1 eb109.C
*** eb109.C 1998/05/27 23:00:35 1.1
--- eb109.C 1998/06/02 08:02:32
*************** template<class VertexType, class EdgeTyp
*** 39,57 ****
ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
{
// display of vertices with successors
! for(int i = 0; i < G.size(); ++i)
{
! os << G[i].first << " <";
// The compiler does not like this line!!!!!!
typename Graph<VertexType, EdgeType>::Successor::iterator
! startN = G[i].second.begin(),
! endN = G[i].second.end();
while(startN != endN)
{
os << G[(*startN).first].first << ' ' // vertex
! << (*startN).second << ' '; // edge value
++startN;
}
os << ">\n";
--- 39,57 ----
ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
{
// display of vertices with successors
! for(int i = 0; i < G.size(); ++i) // ERROR - no size function
{
! os << G[i].first << " <"; // ERROR - no index operator
// The compiler does not like this line!!!!!!
typename Graph<VertexType, EdgeType>::Successor::iterator
! startN = G[i].second.begin(), // ERROR - no index operator
! endN = G[i].second.end(); // ERROR - no index operator
while(startN != endN)
{
os << G[(*startN).first].first << ' ' // vertex
! << (*startN).second << ' '; // ERROR - no index operator
++startN;
}
os << ">\n";
*************** ostream& operator<<(ostream& os, Graph<V
*** 62,68 ****
int main()
{
// no edge weighting, therefore type Empty:
! Graph<string, Empty> V(true); // directed
// ReadGraph(V, "gra1.dat");
// display of vertices with successors
--- 62,68 ----
int main()
{
// no edge weighting, therefore type Empty:
! Graph<string, Empty> V(true); // ERROR - no bool constructor
// ReadGraph(V, "gra1.dat");
// display of vertices with successors