Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 291)
+++ lemon/lgf_reader.h	(revision 294)
@@ -393,11 +393,12 @@
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph,
+                                       std::istream& is = std::cin);
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(const std::string& fn, Digraph& digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const std::string& fn);
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(const char *fn, Digraph& digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char *fn);
 
   /// \ingroup lemon_io
@@ -422,5 +423,5 @@
   ///
   ///\code
-  /// DigraphReader<Digraph>(std::cin, digraph).
+  /// DigraphReader<Digraph>(digraph, std::cin).
   ///   nodeMap("coordinates", coord_map).
   ///   arcMap("capacity", cap_map).
@@ -503,5 +504,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// input stream.
-    DigraphReader(std::istream& is, Digraph& digraph)
+    DigraphReader(Digraph& digraph, std::istream& is = std::cin)
       : _is(&is), local_is(false), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
@@ -512,5 +513,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(const std::string& fn, Digraph& digraph)
+    DigraphReader(Digraph& digraph, const std::string& fn)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -524,5 +525,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(const char* fn, Digraph& digraph)
+    DigraphReader(Digraph& digraph, const char* fn)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -557,10 +558,10 @@
   private:
 
-    friend DigraphReader<Digraph> digraphReader<>(std::istream& is,
-                                                  Digraph& digraph);
-    friend DigraphReader<Digraph> digraphReader<>(const std::string& fn,
-                                                  Digraph& digraph);
-    friend DigraphReader<Digraph> digraphReader<>(const char *fn,
-                                                  Digraph& digraph);
+    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
+                                                  std::istream& is);
+    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
+                                                  const std::string& fn);
+    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
+                                                  const char *fn);
 
     DigraphReader(DigraphReader& other)
@@ -1188,6 +1189,7 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph) {
-    DigraphReader<Digraph> tmp(is, digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph,
+                                       std::istream& is = std::cin) {
+    DigraphReader<Digraph> tmp(digraph, is);
     return tmp;
   }
@@ -1198,7 +1200,7 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(const std::string& fn,
-                                       Digraph& digraph) {
-    DigraphReader<Digraph> tmp(fn, digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph,
+                                       const std::string& fn) {
+    DigraphReader<Digraph> tmp(digraph, fn);
     return tmp;
   }
@@ -1209,6 +1211,6 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(const char* fn, Digraph& digraph) {
-    DigraphReader<Digraph> tmp(fn, digraph);
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
+    DigraphReader<Digraph> tmp(digraph, fn);
     return tmp;
   }
@@ -1218,11 +1220,12 @@
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(std::istream& is, Graph& graph);
+  GraphReader<Graph> graphReader(Graph& graph,
+                                 std::istream& is = std::cin);
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(const std::string& fn, Graph& graph);
+  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn);
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(const char *fn, Graph& graph);
+  GraphReader<Graph> graphReader(Graph& graph, const char *fn);
 
   /// \ingroup lemon_io
@@ -1292,5 +1295,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// input stream.
-    GraphReader(std::istream& is, Graph& graph)
+    GraphReader(Graph& graph, std::istream& is = std::cin)
       : _is(&is), local_is(false), _graph(graph),
         _use_nodes(false), _use_edges(false),
@@ -1301,5 +1304,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(const std::string& fn, Graph& graph)
+    GraphReader(Graph& graph, const std::string& fn)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _graph(graph),
@@ -1313,5 +1316,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(const char* fn, Graph& graph)
+    GraphReader(Graph& graph, const char* fn)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _graph(graph),
@@ -1345,8 +1348,8 @@
 
   private:
-    friend GraphReader<Graph> graphReader<>(std::istream& is, Graph& graph);
-    friend GraphReader<Graph> graphReader<>(const std::string& fn,
-                                            Graph& graph);
-    friend GraphReader<Graph> graphReader<>(const char *fn, Graph& graph);
+    friend GraphReader<Graph> graphReader<>(Graph& graph, std::istream& is);
+    friend GraphReader<Graph> graphReader<>(Graph& graph,
+                                            const std::string& fn);
+    friend GraphReader<Graph> graphReader<>(Graph& graph, const char *fn);
 
     GraphReader(GraphReader& other)
@@ -2022,6 +2025,6 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(std::istream& is, Graph& graph) {
-    GraphReader<Graph> tmp(is, graph);
+  GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) {
+    GraphReader<Graph> tmp(graph, is);
     return tmp;
   }
@@ -2032,7 +2035,6 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(const std::string& fn,
-                                       Graph& graph) {
-    GraphReader<Graph> tmp(fn, graph);
+  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) {
+    GraphReader<Graph> tmp(graph, fn);
     return tmp;
   }
@@ -2043,6 +2045,6 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(const char* fn, Graph& graph) {
-    GraphReader<Graph> tmp(fn, graph);
+  GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
+    GraphReader<Graph> tmp(graph, fn);
     return tmp;
   }
