Simplify hello_lemon.cc with 'using namespace' commands
authorPeter Kovacs <kpeter@inf.elte.hu>
Sat, 20 Feb 2010 19:02:04 +0100
changeset 36199a65b64d90
parent 35 f7a4e8024952
child 37 c8be1109221b
Simplify hello_lemon.cc with 'using namespace' commands
demo/hello_lemon.cc
     1.1 --- a/demo/hello_lemon.cc	Wed Feb 17 17:42:19 2010 +0000
     1.2 +++ b/demo/hello_lemon.cc	Sat Feb 20 19:02:04 2010 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2009
     1.8 + * Copyright (C) 2003-2010
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -25,19 +25,20 @@
    1.13  #include <iostream>
    1.14  #include <lemon/list_graph.h>
    1.15  
    1.16 +using namespace lemon;
    1.17 +using namespace std;
    1.18 +
    1.19  int main()
    1.20  {
    1.21 -  typedef lemon::ListDigraph Graph;
    1.22 -  Graph g;
    1.23 +  ListDigraph g;
    1.24  
    1.25 -  Graph::Node u = g.addNode();
    1.26 -  Graph::Node v = g.addNode();
    1.27 -  Graph::Arc  e = g.addArc(u, v);
    1.28 +  ListDigraph::Node u = g.addNode();
    1.29 +  ListDigraph::Node v = g.addNode();
    1.30 +  ListDigraph::Arc  a = g.addArc(u, v);
    1.31  
    1.32 -  std::cout << "Hello World! This is LEMON library here." << std::endl;
    1.33 -  std::cout << "We have a directed graph with "
    1.34 -            << countNodes(g) << " nodes and "
    1.35 -            << countArcs(g) << " arc." << std::endl;
    1.36 +  cout << "Hello World! This is LEMON library here." << endl;
    1.37 +  cout << "We have a directed graph with " << countNodes(g) << " nodes "
    1.38 +       << "and " << countArcs(g) << " arc." << endl;
    1.39  
    1.40    return 0;
    1.41  }