fork download
  1. #include <vector>
  2. using namespace std;
  3.  
  4. template<class ntype, class etype>
  5. class node {
  6.  
  7. class edge {
  8. etype payload;
  9. node<ntype, etype>* to;
  10. node<ntype, etype>* from;
  11. };
  12.  
  13. ntype payload;
  14. vector< edge > incoming; // How to avoid recursion ???
  15. vector< edge > outgoing; // ????
  16. };
  17.  
  18. template<class ntype, class etype>
  19. class graph {
  20.  
  21. vector< node<ntype, etype> > nodes;
  22. };
  23.  
  24. int main() {
  25. graph<int, int> g;
  26. return 0;
  27. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Standard output is empty