Index: demo/lgf_demo.cc
===================================================================
--- demo/lgf_demo.cc	(revision 294)
+++ demo/lgf_demo.cc	(revision 290)
@@ -45,5 +45,5 @@
 
   try {
-    digraphReader(g, "digraph.lgf"). // read the directed graph into g
+    digraphReader("digraph.lgf", g). // read the directed graph into g
       arcMap("capacity", cap).       // read the 'capacity' arc map into cap
       node("source", s).             // read 'source' node to s
@@ -61,5 +61,5 @@
   std::cout << "We can write it to the standard output:" << std::endl;
 
-  digraphWriter(g).                // write g to the standard output
+  digraphWriter(std::cout, g).     // write g to the standard output
     arcMap("capacity", cap).       // write cap into 'capacity'
     node("source", s).             // write s to 'source'
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 294)
+++ lemon/lgf_reader.h	(revision 291)
@@ -393,12 +393,11 @@
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph,
-                                       std::istream& is = std::cin);
+  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph);
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph, const std::string& fn);
+  DigraphReader<Digraph> digraphReader(const std::string& fn, Digraph& digraph);
 
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char *fn);
+  DigraphReader<Digraph> digraphReader(const char *fn, Digraph& digraph);
 
   /// \ingroup lemon_io
@@ -423,5 +422,5 @@
   ///
   ///\code
-  /// DigraphReader<Digraph>(digraph, std::cin).
+  /// DigraphReader<Digraph>(std::cin, digraph).
   ///   nodeMap("coordinates", coord_map).
   ///   arcMap("capacity", cap_map).
@@ -504,5 +503,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// input stream.
-    DigraphReader(Digraph& digraph, std::istream& is = std::cin)
+    DigraphReader(std::istream& is, Digraph& digraph)
       : _is(&is), local_is(false), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
@@ -513,5 +512,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(Digraph& digraph, const std::string& fn)
+    DigraphReader(const std::string& fn, Digraph& digraph)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -525,5 +524,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(Digraph& digraph, const char* fn)
+    DigraphReader(const char* fn, Digraph& digraph)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -558,10 +557,10 @@
   private:
 
-    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);
+    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);
 
     DigraphReader(DigraphReader& other)
@@ -1189,7 +1188,6 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph,
-                                       std::istream& is = std::cin) {
-    DigraphReader<Digraph> tmp(digraph, is);
+  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph) {
+    DigraphReader<Digraph> tmp(is, digraph);
     return tmp;
   }
@@ -1200,7 +1198,7 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph,
-                                       const std::string& fn) {
-    DigraphReader<Digraph> tmp(digraph, fn);
+  DigraphReader<Digraph> digraphReader(const std::string& fn,
+                                       Digraph& digraph) {
+    DigraphReader<Digraph> tmp(fn, digraph);
     return tmp;
   }
@@ -1211,6 +1209,6 @@
   /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
-    DigraphReader<Digraph> tmp(digraph, fn);
+  DigraphReader<Digraph> digraphReader(const char* fn, Digraph& digraph) {
+    DigraphReader<Digraph> tmp(fn, digraph);
     return tmp;
   }
@@ -1220,12 +1218,11 @@
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph,
-                                 std::istream& is = std::cin);
+  GraphReader<Graph> graphReader(std::istream& is, Graph& graph);
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn);
+  GraphReader<Graph> graphReader(const std::string& fn, Graph& graph);
 
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, const char *fn);
+  GraphReader<Graph> graphReader(const char *fn, Graph& graph);
 
   /// \ingroup lemon_io
@@ -1295,5 +1292,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// input stream.
-    GraphReader(Graph& graph, std::istream& is = std::cin)
+    GraphReader(std::istream& is, Graph& graph)
       : _is(&is), local_is(false), _graph(graph),
         _use_nodes(false), _use_edges(false),
@@ -1304,5 +1301,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(Graph& graph, const std::string& fn)
+    GraphReader(const std::string& fn, Graph& graph)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _graph(graph),
@@ -1316,5 +1313,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(Graph& graph, const char* fn)
+    GraphReader(const char* fn, Graph& graph)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _graph(graph),
@@ -1348,8 +1345,8 @@
 
   private:
-    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);
+    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);
 
     GraphReader(GraphReader& other)
@@ -2025,6 +2022,6 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) {
-    GraphReader<Graph> tmp(graph, is);
+  GraphReader<Graph> graphReader(std::istream& is, Graph& graph) {
+    GraphReader<Graph> tmp(is, graph);
     return tmp;
   }
@@ -2035,6 +2032,7 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) {
-    GraphReader<Graph> tmp(graph, fn);
+  GraphReader<Graph> graphReader(const std::string& fn,
+                                       Graph& graph) {
+    GraphReader<Graph> tmp(fn, graph);
     return tmp;
   }
@@ -2045,6 +2043,6 @@
   /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
-    GraphReader<Graph> tmp(graph, fn);
+  GraphReader<Graph> graphReader(const char* fn, Graph& graph) {
+    GraphReader<Graph> tmp(fn, graph);
     return tmp;
   }
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 294)
+++ lemon/lgf_writer.h	(revision 291)
@@ -353,14 +353,14 @@
 
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       std::ostream& os = std::cout);
+  DigraphWriter<Digraph> digraphWriter(std::ostream& os,
+                                       const Digraph& digraph);
 
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const std::string& fn);
+  DigraphWriter<Digraph> digraphWriter(const std::string& fn,
+                                       const Digraph& digraph);
 
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const char *fn);
+  DigraphWriter<Digraph> digraphWriter(const char *fn,
+                                       const Digraph& digraph);
 
   /// \ingroup lemon_io
@@ -383,5 +383,5 @@
   ///
   ///\code
-  /// DigraphWriter<Digraph>(digraph, std::cout).
+  /// DigraphWriter<Digraph>(std::cout, digraph).
   ///   nodeMap("coordinates", coord_map).
   ///   nodeMap("size", size).
@@ -453,6 +453,6 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    DigraphWriter(const Digraph& digraph, std::ostream& os = std::cout)
-      : _os(&os), local_os(false), _digraph(digraph),
+    DigraphWriter(std::ostream& is, const Digraph& digraph)
+      : _os(&is), local_os(false), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {}
 
@@ -461,5 +461,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const Digraph& digraph, const std::string& fn)
+    DigraphWriter(const std::string& fn, const Digraph& digraph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {
@@ -471,5 +471,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const Digraph& digraph, const char* fn)
+    DigraphWriter(const char* fn, const Digraph& digraph)
       : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {
@@ -501,10 +501,10 @@
   private:
 
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  std::ostream& os);
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  const std::string& fn);
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  const char *fn);
+    friend DigraphWriter<Digraph> digraphWriter<>(std::ostream& os,
+                                                  const Digraph& digraph);
+    friend DigraphWriter<Digraph> digraphWriter<>(const std::string& fn,
+                                                  const Digraph& digraph);
+    friend DigraphWriter<Digraph> digraphWriter<>(const char *fn,
+                                                  const Digraph& digraph);
 
     DigraphWriter(DigraphWriter& other)
@@ -913,7 +913,7 @@
   /// \relates DigraphWriter
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       std::ostream& os = std::cout) {
-    DigraphWriter<Digraph> tmp(digraph, os);
+  DigraphWriter<Digraph> digraphWriter(std::ostream& os,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(os, digraph);
     return tmp;
   }
@@ -924,7 +924,7 @@
   /// \relates DigraphWriter
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const std::string& fn) {
-    DigraphWriter<Digraph> tmp(digraph, fn);
+  DigraphWriter<Digraph> digraphWriter(const std::string& fn,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(fn, digraph);
     return tmp;
   }
@@ -935,7 +935,7 @@
   /// \relates DigraphWriter
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const char* fn) {
-    DigraphWriter<Digraph> tmp(digraph, fn);
+  DigraphWriter<Digraph> digraphWriter(const char* fn,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(fn, digraph);
     return tmp;
   }
@@ -945,12 +945,11 @@
 
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph,
-                                 std::ostream& os = std::cout);
+  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph& graph);
 
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn);
+  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph& graph);
 
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const char *fn);
+  GraphWriter<Graph> graphWriter(const char *fn, const Graph& graph);
 
   /// \ingroup lemon_io
@@ -1014,6 +1013,6 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    GraphWriter(const Graph& graph, std::ostream& os = std::cout)
-      : _os(&os), local_os(false), _graph(graph),
+    GraphWriter(std::ostream& is, const Graph& graph)
+      : _os(&is), local_os(false), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {}
 
@@ -1022,5 +1021,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const Graph& graph, const std::string& fn)
+    GraphWriter(const std::string& fn, const Graph& graph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {
@@ -1032,5 +1031,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const Graph& graph, const char* fn)
+    GraphWriter(const char* fn, const Graph& graph)
       : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {
@@ -1062,10 +1061,10 @@
   private:
 
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            std::ostream& os);
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            const std::string& fn);
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            const char *fn);
+    friend GraphWriter<Graph> graphWriter<>(std::ostream& os,
+                                            const Graph& graph);
+    friend GraphWriter<Graph> graphWriter<>(const std::string& fn,
+                                            const Graph& graph);
+    friend GraphWriter<Graph> graphWriter<>(const char *fn,
+                                            const Graph& graph);
 
     GraphWriter(GraphWriter& other)
@@ -1520,7 +1519,6 @@
   /// \relates GraphWriter
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph,
-                                 std::ostream& os = std::cout) {
-    GraphWriter<Graph> tmp(graph, os);
+  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph& graph) {
+    GraphWriter<Graph> tmp(os, graph);
     return tmp;
   }
@@ -1531,6 +1529,6 @@
   /// \relates GraphWriter
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
-    GraphWriter<Graph> tmp(graph, fn);
+  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph& graph) {
+    GraphWriter<Graph> tmp(fn, graph);
     return tmp;
   }
@@ -1541,6 +1539,6 @@
   /// \relates GraphWriter
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
-    GraphWriter<Graph> tmp(graph, fn);
+  GraphWriter<Graph> graphWriter(const char* fn, const Graph& graph) {
+    GraphWriter<Graph> tmp(fn, graph);
     return tmp;
   }
Index: test/bfs_test.cc
===================================================================
--- test/bfs_test.cc	(revision 293)
+++ test/bfs_test.cc	(revision 286)
@@ -145,5 +145,5 @@
 
   std::istringstream input(test_lgf);
-  digraphReader(G, input).
+  digraphReader(input, G).
     node("source", s).
     node("target", t).
Index: test/dfs_test.cc
===================================================================
--- test/dfs_test.cc	(revision 293)
+++ test/dfs_test.cc	(revision 286)
@@ -147,5 +147,5 @@
 
   std::istringstream input(test_lgf);
-  digraphReader(G, input).
+  digraphReader(input, G).
     node("source", s).
     node("target", t).
Index: test/dijkstra_test.cc
===================================================================
--- test/dijkstra_test.cc	(revision 293)
+++ test/dijkstra_test.cc	(revision 286)
@@ -143,5 +143,5 @@
 
   std::istringstream input(test_lgf);
-  digraphReader(G, input).
+  digraphReader(input, G).
     arcMap("length", length).
     node("source", s).
Index: test/heap_test.cc
===================================================================
--- test/heap_test.cc	(revision 293)
+++ test/heap_test.cc	(revision 257)
@@ -168,5 +168,5 @@
 
   std::istringstream input(test_lgf);
-  digraphReader(digraph, input).
+  digraphReader(input, digraph).
     arcMap("capacity", length).
     node("source", source).
