src/work/list_graph.h
changeset 435 8f1dece01cc4
parent 389 770cc1f4861f
child 436 6d632cb56ea3
equal deleted inserted replaced
13:6c235aab4950 14:1a45aec4109f
   367     }
   367     }
   368 
   368 
   369     /* stream operations, for testing purpose */
   369     /* stream operations, for testing purpose */
   370 
   370 
   371     friend std::ostream& operator<<(std::ostream& os, const Node& i) { 
   371     friend std::ostream& operator<<(std::ostream& os, const Node& i) { 
   372       os << i.node->id; return os; 
   372       if (i.valid())
       
   373 	os << i.node->id; 
       
   374       else
       
   375 	os << "invalid";
       
   376       return os; 
   373     }
   377     }
   374     friend std::ostream& operator<<(std::ostream& os, const Edge& i) { 
   378     friend std::ostream& operator<<(std::ostream& os, const Edge& i) { 
   375       os << "(" << i.edge->_tail->id << "--" << i.edge->id << "->" << i.edge->_head->id << ")"; 
   379       if (i.valid()) 
       
   380 	os << "(" << i.edge->_tail->id << "--" << i.edge->id << "->" << i.edge->_head->id << ")"; 
       
   381       else 
       
   382 	os << "invalid";
   376       return os; 
   383       return os; 
   377     }
   384     }
   378 
   385 
   379     class Node {
   386     class Node {
   380       friend class ListGraph;
   387       friend class ListGraph;