Index: lemon/lemon_reader.h
===================================================================
--- lemon/lemon_reader.h	(revision 1477)
+++ lemon/lemon_reader.h	(revision 1492)
@@ -50,5 +50,5 @@
       bool isIdReader() { return true; }
 
-      Item readId(std::istream&, Item) { return Item();}
+      void readId(std::istream&, Item&) {}
       
       template <class _ItemIdReader>
@@ -57,7 +57,25 @@
 	  bool b = reader.isIdReader();
 	  ignore_unused_variable_warning(b);
-	  Item item = reader.readId(is, Item());
+	  Item item;
+	  reader.readId(is, item);
 	}
 	_ItemIdReader& reader;
+	std::istream& is;
+      };
+
+    };
+
+    template <typename Item>
+    class ItemReader {
+    public:
+      void read(std::istream&, Item&) {}
+      
+      template <class _ItemReader>
+      struct Constraints {
+	void constraints() {
+	  Item item;
+	  reader.read(is, item);
+	}
+	_ItemReader& reader;
 	std::istream& is;
       };
@@ -570,5 +588,7 @@
 
       virtual Item read(std::istream& is) const {
-	return boxedIdReader.readId(is, Item());
+	Item item;
+	boxedIdReader.readId(is, item);
+	return item;
       }
 
@@ -697,4 +717,6 @@
     NodeSetReader& _readMap(std::string name, MapParameter map, 
 			    const Reader& reader = Reader()) {
+      checkConcept<concept::WriteMap<Node, typename Map::Value>, Map>();
+      checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>();
       if (readers.find(name) != readers.end()) {
 	ErrorMessage msg;
@@ -783,6 +805,6 @@
     /// It reads an id from the stream and gives back which node belongs to
     /// it. It is possible only if there was read an "id" named map.
-    Node readId(std::istream& is, Node = Node()) const {
-      return inverter->read(is);
+    void readId(std::istream& is, Node& node) const {
+      node = inverter->read(is);
     } 
 
@@ -905,4 +927,6 @@
     EdgeSetReader& _readMap(std::string name, MapParameter map, 
 			    const Reader& reader = Reader()) {
+      checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>();
+      checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>();
       if (readers.find(name) != readers.end()) {
 	ErrorMessage msg;
@@ -996,6 +1020,6 @@
     /// It reads an id from the stream and gives back which edge belongs to
     /// it. It is possible only if there was read an "id" named map.
-    Edge readId(std::istream& is, Edge = Edge()) const {
-      return inverter->read(is);
+    void readId(std::istream& is, Edge& edge) const {
+      edge = inverter->read(is);
     } 
 
@@ -1125,4 +1149,6 @@
     UndirEdgeSetReader& _readMap(std::string name, MapParameter map,
 				 const Reader& reader = Reader()) {
+      checkConcept<concept::WriteMap<UndirEdge, typename Map::Value>, Map>();
+      checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>();
       if (readers.find(name) != readers.end()) {
 	ErrorMessage msg;
@@ -1191,5 +1217,7 @@
     template <typename Reader, typename Map, typename MapParameter>
     UndirEdgeSetReader& _readDirMap(std::string name, MapParameter map,
-				    const Reader& reader = Reader()) {
+				    const Reader& reader = Reader()) { 
+      checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>();
+      checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>();
       readMap("+" + name, 
 	      _reader_bits::writeComposeMap(map, forwardMap(graph)), reader);
@@ -1276,6 +1304,6 @@
     /// It reads an id from the stream and gives back which undirected edge 
     /// belongs to it. It is possible only if there was read an "id" named map.
-    UndirEdge readId(std::istream& is, UndirEdge = UndirEdge()) const {
-      return inverter->read(is);
+    void readId(std::istream& is, UndirEdge& undirEdge) const {
+      undirEdge = inverter->read(is);
     } 
 
@@ -1286,12 +1314,12 @@
     /// and the undirected edge id. It is possible only if there was read 
     /// an "id" named map.
-    Edge readId(std::istream& is, Edge = Edge()) const {
+    void readId(std::istream& is, Edge& edge) const {
       char c;
       is >> c;
       UndirEdge undirEdge = inverter->read(is);
       if (c == '+') {
-	return graph.edgeWithSource(undirEdge, graph.source(undirEdge));
+	edge = graph.edgeWithSource(undirEdge, graph.source(undirEdge));
       } else if (c == '-') {
-	return graph.edgeWithSource(undirEdge, graph.target(undirEdge));
+        edge = graph.edgeWithSource(undirEdge, graph.target(undirEdge));
       } else {
 	throw DataFormatError("Wrong id format for edge "
@@ -1341,5 +1369,5 @@
       : Parent(_reader), id(_id) {
       checkConcept<_reader_bits::ItemIdReader<Node>, _IdReader>();
-      idReader.reset(new IdReader<Node, _IdReader>(_idReader));
+      nodeIdReader.reset(new IdReader<Node, _IdReader>(_idReader));
     }
 
@@ -1386,5 +1414,5 @@
     /// It reads the content of the section.
     virtual void read(std::istream& is) {
-      if (!idReader->isIdReader()) {
+      if (!nodeIdReader->isIdReader()) {
 	throw DataFormatError("Cannot find nodeset or ID map");
       }
@@ -1396,5 +1424,5 @@
 	typename NodeReaders::iterator it = readers.find(id);
 	if (it != readers.end()) {
-	  *(it->second) = idReader->read(ls); 
+	  *(it->second) = nodeIdReader->read(ls); 
 	}	
       }
@@ -1407,5 +1435,5 @@
     typedef std::map<std::string, Node*> NodeReaders;
     NodeReaders readers;
-    std::auto_ptr<IdReaderBase<Node> > idReader;
+    std::auto_ptr<IdReaderBase<Node> > nodeIdReader;
   };
 
@@ -1438,5 +1466,5 @@
       : Parent(_reader), id(_id) {
       checkConcept<_reader_bits::ItemIdReader<Edge>, _IdReader>();
-      idReader.reset(new IdReader<Edge, _IdReader>(_idReader));
+      edgeIdReader.reset(new IdReader<Edge, _IdReader>(_idReader));
     }
 
@@ -1482,5 +1510,5 @@
     /// It reads the content of the section.
     virtual void read(std::istream& is) {
-      if (!idReader->isIdReader()) {
+      if (!edgeIdReader->isIdReader()) {
 	throw DataFormatError("Cannot find edgeset or ID map");
       }
@@ -1492,5 +1520,5 @@
 	typename EdgeReaders::iterator it = readers.find(id);
 	if (it != readers.end()) {
-	  *(it->second) = idReader->read(ls); 
+	  *(it->second) = edgeIdReader->read(ls); 
 	}	
       }
@@ -1503,5 +1531,5 @@
     typedef std::map<std::string, Edge*> EdgeReaders;
     EdgeReaders readers;
-    std::auto_ptr<IdReaderBase<Edge> > idReader;
+    std::auto_ptr<IdReaderBase<Edge> > edgeIdReader;
   };
 
@@ -1689,4 +1717,5 @@
     AttributeReader& readAttribute(const std::string& name, Value& value,
 				   const Reader& reader = Reader()) {
+      checkConcept<_reader_bits::ItemReader<Value>, Reader>();
       if (readers.find(name) != readers.end()) {
 	ErrorMessage msg;
Index: lemon/lemon_writer.h
===================================================================
--- lemon/lemon_writer.h	(revision 1476)
+++ lemon/lemon_writer.h	(revision 1492)
@@ -56,5 +56,4 @@
       struct Constraints {
 	void constraints() {
-	  const Item item;
 	  bool b = writer.isIdWriter();
 	  ignore_unused_variable_warning(b);
@@ -63,4 +62,23 @@
 	_ItemIdWriter& writer;
 	std::ostream& os;
+	const Item& item;
+      };
+
+    };
+
+    template <typename Item>
+    class ItemWriter {
+    public:
+
+      void write(std::ostream&, const Item&) {}
+      
+      template <class _ItemWriter>
+      struct Constraints {
+	void constraints() {
+	  writer.write(os, item);
+	}
+	_ItemWriter& writer;
+	std::ostream& os;
+	const Item& item;
       };
 
@@ -353,5 +371,6 @@
     NodeSetWriter& writeNodeMap(std::string name, const Map& map, 
 			    const Writer& writer = Writer()) {
-      checkConcept<concept::WriteMap<Node, typename Map::Value>, Map>();
+      checkConcept<concept::ReadMap<Node, typename Map::Value>, Map>();
+      checkConcept<_writer_bits::ItemWriter<typename Map::Value>, Writer>();
       writers.push_back(
 	make_pair(name, new MapWriter<Node, Map, Writer>(map, writer)));
@@ -518,5 +537,6 @@
     EdgeSetWriter& writeEdgeMap(std::string name, const Map& map, 
 			    const Writer& writer = Writer()) {
-      checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>();
+      checkConcept<concept::ReadMap<Edge, typename Map::Value>, Map>();
+      checkConcept<_writer_bits::ItemWriter<typename Map::Value>, Writer>();
       writers.push_back(
 	make_pair(name, new MapWriter<Edge, Map, Writer>(map, writer)));
@@ -699,5 +719,6 @@
     UndirEdgeSetWriter& writeUndirEdgeMap(std::string name, const Map& map, 
 					  const Writer& writer = Writer()) {
-      checkConcept<concept::WriteMap<UndirEdge, typename Map::Value>, Map>();
+      checkConcept<concept::ReadMap<UndirEdge, typename Map::Value>, Map>();
+      checkConcept<_writer_bits::ItemWriter<typename Map::Value>, Writer>();
       writers.push_back(
 	make_pair(name, new MapWriter<UndirEdge, Map, Writer>(map, writer)));
@@ -710,8 +731,6 @@
     template <typename Map>
     UndirEdgeSetWriter& writeEdgeMap(std::string name, const Map& map) {
-      checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>();
-      writeUndirEdgeMap("+" + name, composeMap(forwardMap(graph), map));
-      writeUndirEdgeMap("-" + name, composeMap(backwardMap(graph), map));
-      return *this;
+      return writeEdgeMap<typename Traits::
+	template Writer<typename Map::Value>, Map>(name, map);
     }
 
@@ -722,5 +741,6 @@
     UndirEdgeSetWriter& writeEdgeMap(std::string name, const Map& map, 
 				     const Writer& writer = Writer()) {
-      checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>();
+      checkConcept<concept::ReadMap<Edge, typename Map::Value>, Map>();
+      checkConcept<_writer_bits::ItemWriter<typename Map::Value>, Writer>();
       writeUndirEdge("+" + name, composeMap(forwardMap(graph), map), writer);
       writeUndirEdge("-" + name, composeMap(backwardMap(graph), map), writer);
@@ -1161,4 +1181,5 @@
 				    const Value& value,
 				    const Writer& writer = Writer()) {
+      checkConcept<_writer_bits::ItemWriter<Value>, Writer>();
       writers.push_back(make_pair(name, new ValueWriter<Value, Writer>
       			       (value, writer)));
