Index: lemon/counter.h
===================================================================
--- lemon/counter.h	(revision 121)
+++ lemon/counter.h	(revision 160)
@@ -97,10 +97,44 @@
   /// @{
 
-  ///A counter class
-
-  ///This class makes it easier to count certain events. You can increment
-  ///or decrement the counter using operator++ and operator--.
-  ///A report is automatically printed on destruction.
-  ///\todo More doc
+  /// A counter class
+
+  /// This class makes it easier to count certain events (e.g. for debug
+  /// reasons).
+  /// You can increment or decrement the counter using \c operator++,
+  /// \c operator--, \c operator+= and \c operator-=. You can also
+  /// define subcounters for the different phases of the algorithm or
+  /// for different types of operations.
+  /// A report containing the given title and the value of the counter
+  /// is automatically printed on destruction. 
+  ///
+  /// The following example shows the usage of counters and subcounters.
+  /// \code
+  /// // Bubble sort
+  /// std::vector<T> v;
+  /// ...
+  /// Counter op("Operations: ");
+  /// Counter::SubCounter as(op, "Assignments: ");
+  /// Counter::SubCounter co(op, "Comparisons: ");
+  /// for (int i = v.size()-1; i > 0; --i) {
+  ///   for (int j = 0; j < i; ++j) {
+  ///     if (v[j] > v[j+1]) {
+  ///       T tmp = v[j];
+  ///       v[j] = v[j+1];
+  ///       v[j+1] = tmp;
+  ///       as += 3;          // three assignments
+  ///     }
+  ///     ++co;               // one comparison
+  ///   }
+  /// }
+  /// \endcode
+  ///
+  /// This code prints out something like that:
+  /// \code
+  /// Comparisons: 45
+  /// Assignments: 57
+  /// Operations: 102
+  /// \endcode
+  ///
+  /// \sa NoCounter
   class Counter 
   {
@@ -109,24 +143,49 @@
     int count;
   public:
-    ///\e
-
-    ///\todo document please.
+
+    /// SubCounter class
+    
+    /// This class can be used to setup subcounters for a \ref Counter
+    /// to have finer reports. A subcounter provides exactly the same
+    /// operations as the main \ref Counter, but it also increments and
+    /// decrements the value of its parent.
+    /// Subcounters can also have subcounters.
+    /// 
+    /// The parent counter must be given as the first parameter of the
+    /// constructor. Apart from that a title and an \c ostream object
+    /// can also be given just like for the main \ref Counter.
     ///
+    /// A report containing the given title and the value of the
+    /// subcounter is automatically printed on destruction. If you
+    /// would like to turn off this report, use \ref NoSubCounter
+    /// instead.
+    /// 
+    /// \sa NoSubCounter
     typedef _SubCounter<Counter> SubCounter;
-    ///\e
-
-    ///\todo document please.
+
+    /// SubCounter class without printing report on destruction 
+    
+    /// This class can be used to setup subcounters for a \ref Counter.
+    /// It is the same as \ref SubCounter but it does not print report
+    /// on destruction. (It modifies the value of its parent, so 'No'
+    /// only means 'do not print'.)
     ///
+    /// Replacing \ref SubCounter "SubCounter"s with \ref NoSubCounter
+    /// "NoSubCounter"s makes it possible to turn off reporting 
+    /// subcounter values without actually removing the definitions
+    /// and the increment or decrement operators.
+    ///
+    /// \sa SubCounter
     typedef _NoSubCounter<Counter> NoSubCounter;
 
-    ///\e
+    /// Constructor.
     Counter() : _title(), _os(std::cerr), count(0) {}
-    ///\e
+    /// Constructor.
     Counter(std::string title,std::ostream &os=std::cerr) 
       : _title(title), _os(os), count(0) {}
-    ///\e
+    /// Constructor.
     Counter(const char *title,std::ostream &os=std::cerr)
       : _title(title), _os(os), count(0) {}
-    ///Destructor. Prints the given title and the value of the counter.
+    /// Destructor. Prints the given title and the value of the counter.
     ~Counter() {
       _os << _title << count <<std::endl;
@@ -144,14 +203,21 @@
     ///\e
     Counter &operator-=(int c) { count-=c; return *this;}
-    ///\e
+    /// Resets the counter to the given value.
     void reset(int c=0) {count=c;}
-    ///\e
+    /// Returns the value of the counter.
     operator int() {return count;}
   };
 
-  ///'Do nothing' version of \ref Counter
-
-  ///'Do nothing' version of \ref Counter.
-  ///\sa Counter
+  /// 'Do nothing' version of Counter.
+
+  /// This class can be used in the same way as \ref Counter however it
+  /// does not count at all and does not print report on destruction.
+  ///
+  /// Replacing a \ref Counter with a \ref NoCounter makes it possible
+  /// to turn off all counting and reporting (SubCounters should also
+  /// be replaced with NoSubCounters), so it does not affect the
+  /// efficiency of the program at all.
+  ///
+  /// \sa Counter
   class NoCounter
   {
Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 159)
+++ lemon/maps.h	(revision 123)
@@ -1675,4 +1675,13 @@
   namespace _maps_bits {
 
+    template <typename Value>
+    struct Identity {
+      typedef Value argument_type;
+      typedef Value result_type;
+      Value operator()(const Value& val) const {
+	return val;
+      }
+    };
+
     template <typename _Iterator, typename Enable = void>
     struct IteratorTraits {
@@ -1691,31 +1700,18 @@
   /// \brief Writable bool map for logging each \c true assigned element
   ///
-  /// A \ref concepts::WriteMap "writable" bool map for logging
+  /// A \ref concepts::ReadWriteMap "read-write" bool map for logging
   /// each \c true assigned element, i.e it copies subsequently each
   /// keys set to \c true to the given iterator.
-  /// The most important usage of it is storing certain nodes or arcs
-  /// that were marked \c true by an algorithm.
-  ///
-  /// There are several algorithms that provide solutions through bool
-  /// maps and most of them assign \c true at most once for each key.
-  /// In these cases it is a natural request to store each \c true
-  /// assigned elements (in order of the assignment), which can be
-  /// easily done with StoreBoolMap.
-  ///
-  /// The simplest way of using this map is through the storeBoolMap()
-  /// function.
-  ///
-  /// \tparam It The type of the iterator.
-  /// \tparam Ke The key type of the map. The default value set
-  /// according to the iterator type should work in most cases.
+  ///
+  /// \tparam It the type of the Iterator.
+  /// \tparam Ke the type of the map's Key. The default value should
+  /// work in most cases.
   ///
   /// \note The container of the iterator must contain enough space
-  /// for the elements or the iterator should be an inserter iterator.
-#ifdef DOXYGEN
-  template <typename It, typename Ke>
-#else
+  /// for the elements. (Or it should be an inserter iterator).
+  ///
+  /// \todo Revise the name of this class and give an example code.
   template <typename It,
 	    typename Ke=typename _maps_bits::IteratorTraits<It>::Value>
-#endif
   class StoreBoolMap {
   public:
@@ -1740,5 +1736,5 @@
 
     /// The set function of the map
-    void set(const Key& key, Value value) {
+    void set(const Key& key, Value value) const {
       if (value) {
 	*_end++ = key;
@@ -1748,36 +1744,6 @@
   private:
     Iterator _begin;
-    Iterator _end;
-  };
-  
-  /// Returns a \ref StoreBoolMap class
-
-  /// This function just returns a \ref StoreBoolMap class.
-  ///
-  /// The most important usage of it is storing certain nodes or arcs
-  /// that were marked \c true by an algorithm.
-  /// For example it makes easier to store the nodes in the processing
-  /// order of Dfs algorithm, as the following examples show.
-  /// \code
-  ///   std::vector<Node> v;
-  ///   dfs(g,s).processedMap(storeBoolMap(std::back_inserter(v))).run();
-  /// \endcode
-  /// \code
-  ///   std::vector<Node> v(countNodes(g));
-  ///   dfs(g,s).processedMap(storeBoolMap(v.begin())).run();
-  /// \endcode
-  ///
-  /// \note The container of the iterator must contain enough space
-  /// for the elements or the iterator should be an inserter iterator.
-  ///
-  /// \note StoreBoolMap is just \ref concepts::WriteMap "writable", so
-  /// it cannot be used when a readable map is needed, for example as
-  /// \c ReachedMap for Bfs, Dfs and Dijkstra algorithms.
-  ///
-  /// \relates StoreBoolMap
-  template<typename Iterator>
-  inline StoreBoolMap<Iterator> storeBoolMap(Iterator it) {
-    return StoreBoolMap<Iterator>(it);
-  }
+    mutable Iterator _end;
+  };
 
   /// @}
Index: test/maps_test.cc
===================================================================
--- test/maps_test.cc	(revision 159)
+++ test/maps_test.cc	(revision 136)
@@ -305,26 +305,4 @@
           "Something is wrong with EqualMap");
   }
-  
-  // StoreBoolMap
-  {
-    typedef std::vector<int> vec;
-    vec v1;
-    vec v2(10);
-    StoreBoolMap<std::back_insert_iterator<vec> > map1(std::back_inserter(v1));
-    StoreBoolMap<vec::iterator> map2(v2.begin());
-    map1.set(10, false);
-    map1.set(20, true);   map2.set(20, true);
-    map1.set(30, false);  map2.set(40, false);
-    map1.set(50, true);   map2.set(50, true);
-    map1.set(60, true);   map2.set(60, true);
-    check(v1.size() == 3 && v2.size() == 10 &&
-          v1[0]==20 && v1[1]==50 && v1[2]==60 && v2[0]==20 && v2[1]==50 && v2[2]==60,
-          "Something is wrong with StoreBoolMap");
-          
-    int i = 0;
-    for ( StoreBoolMap<vec::iterator>::Iterator it = map2.begin();
-          it != map2.end(); ++it )
-      check(v1[i++] == *it, "Something is wrong with StoreBoolMap");
-  }
 
   return 0;
