fork download
  1. #include <list>
  2. #include <memory>
  3. #include <utility>
  4. #include <vector>
  5.  
  6. template <
  7. typename Vertex,
  8. typename Edge,
  9. template <typename, typename> class Container = std::vector,
  10. typename Allocator = std::allocator<void*>
  11. >
  12. class GraphNode
  13. {
  14. public:
  15. typedef GraphNode<Vertex, Edge, Container, Allocator> NodeType;
  16. typedef std::pair< Edge, NodeType* > LinkType;
  17. typedef typename Allocator::template rebind<LinkType>::other AllocatorType;
  18. typedef Container<LinkType, AllocatorType> NeighboursType;
  19.  
  20. Vertex vertex;
  21. NeighboursType neighbours;
  22. };
  23.  
  24. int main() {
  25. GraphNode<long, int> gn0;
  26. GraphNode<long, int, std::list> gn1;
  27. GraphNode<long, int, std::vector> gn2;
  28. }
Success #stdin #stdout 0.02s 2720KB
stdin
Standard input is empty
stdout
Standard output is empty