Index: test/maps_test.cc
===================================================================
--- test/maps_test.cc	(revision 742)
+++ test/maps_test.cc	(revision 767)
@@ -23,5 +23,5 @@
 #include <lemon/concepts/maps.h>
 #include <lemon/maps.h>
-#include <lemon/smart_graph.h>
+#include <lemon/list_graph.h>
 
 #include "test_tools.h"
@@ -330,4 +330,8 @@
   {
     typedef std::vector<int> vec;
+    checkConcept<WriteMap<int, bool>, LoggerBoolMap<vec::iterator> >();
+    checkConcept<WriteMap<int, bool>,
+                 LoggerBoolMap<std::back_insert_iterator<vec> > >();
+
     vec v1;
     vec v2(10);
@@ -350,12 +354,88 @@
       check(v1[i++] == *it, "Something is wrong with LoggerBoolMap");
   }
-
+  
+  // IdMap, RangeIdMap
+  {
+    typedef ListDigraph Graph;
+    DIGRAPH_TYPEDEFS(Graph);
+
+    checkConcept<ReadMap<Node, int>, IdMap<Graph, Node> >();
+    checkConcept<ReadMap<Arc, int>, IdMap<Graph, Arc> >();
+    checkConcept<ReadMap<Node, int>, RangeIdMap<Graph, Node> >();
+    checkConcept<ReadMap<Arc, int>, RangeIdMap<Graph, Arc> >();
+    
+    Graph gr;
+    IdMap<Graph, Node> nmap(gr);
+    IdMap<Graph, Arc> amap(gr);
+    RangeIdMap<Graph, Node> nrmap(gr);
+    RangeIdMap<Graph, Arc> armap(gr);
+    
+    Node n0 = gr.addNode();
+    Node n1 = gr.addNode();
+    Node n2 = gr.addNode();
+    
+    Arc a0 = gr.addArc(n0, n1);
+    Arc a1 = gr.addArc(n0, n2);
+    Arc a2 = gr.addArc(n2, n1);
+    Arc a3 = gr.addArc(n2, n0);
+    
+    check(nmap[n0] == gr.id(n0) && nmap(gr.id(n0)) == n0, "Wrong IdMap");
+    check(nmap[n1] == gr.id(n1) && nmap(gr.id(n1)) == n1, "Wrong IdMap");
+    check(nmap[n2] == gr.id(n2) && nmap(gr.id(n2)) == n2, "Wrong IdMap");
+
+    check(amap[a0] == gr.id(a0) && amap(gr.id(a0)) == a0, "Wrong IdMap");
+    check(amap[a1] == gr.id(a1) && amap(gr.id(a1)) == a1, "Wrong IdMap");
+    check(amap[a2] == gr.id(a2) && amap(gr.id(a2)) == a2, "Wrong IdMap");
+    check(amap[a3] == gr.id(a3) && amap(gr.id(a3)) == a3, "Wrong IdMap");
+
+    check(nmap.inverse()[gr.id(n0)] == n0, "Wrong IdMap::InverseMap");
+    check(amap.inverse()[gr.id(a0)] == a0, "Wrong IdMap::InverseMap");
+    
+    check(nrmap.size() == 3 && armap.size() == 4,
+          "Wrong RangeIdMap::size()");
+
+    check(nrmap[n0] == 0 && nrmap(0) == n0, "Wrong RangeIdMap");
+    check(nrmap[n1] == 1 && nrmap(1) == n1, "Wrong RangeIdMap");
+    check(nrmap[n2] == 2 && nrmap(2) == n2, "Wrong RangeIdMap");
+    
+    check(armap[a0] == 0 && armap(0) == a0, "Wrong RangeIdMap");
+    check(armap[a1] == 1 && armap(1) == a1, "Wrong RangeIdMap");
+    check(armap[a2] == 2 && armap(2) == a2, "Wrong RangeIdMap");
+    check(armap[a3] == 3 && armap(3) == a3, "Wrong RangeIdMap");
+
+    check(nrmap.inverse()[0] == n0, "Wrong RangeIdMap::InverseMap");
+    check(armap.inverse()[0] == a0, "Wrong RangeIdMap::InverseMap");
+    
+    gr.erase(n1);
+    
+    if (nrmap[n0] == 1) nrmap.swap(n0, n2);
+    nrmap.swap(n2, n0);
+    if (armap[a1] == 1) armap.swap(a1, a3);
+    armap.swap(a3, a1);
+    
+    check(nrmap.size() == 2 && armap.size() == 2,
+          "Wrong RangeIdMap::size()");
+
+    check(nrmap[n0] == 1 && nrmap(1) == n0, "Wrong RangeIdMap");
+    check(nrmap[n2] == 0 && nrmap(0) == n2, "Wrong RangeIdMap");
+    
+    check(armap[a1] == 1 && armap(1) == a1, "Wrong RangeIdMap");
+    check(armap[a3] == 0 && armap(0) == a3, "Wrong RangeIdMap");
+
+    check(nrmap.inverse()[0] == n2, "Wrong RangeIdMap::InverseMap");
+    check(armap.inverse()[0] == a3, "Wrong RangeIdMap::InverseMap");
+  }
+  
   // CrossRefMap
   {
-    typedef SmartDigraph Graph;
+    typedef ListDigraph Graph;
     DIGRAPH_TYPEDEFS(Graph);
 
     checkConcept<ReadWriteMap<Node, int>,
                  CrossRefMap<Graph, Node, int> >();
+    checkConcept<ReadWriteMap<Node, bool>,
+                 CrossRefMap<Graph, Node, bool> >();
+    checkConcept<ReadWriteMap<Node, double>,
+                 CrossRefMap<Graph, Node, double> >();
     
     Graph gr;
@@ -371,5 +451,33 @@
     map.set(n1, 'B');
     map.set(n2, 'C');
+    
+    check(map[n0] == 'A' && map('A') == n0 && map.inverse()['A'] == n0,
+          "Wrong CrossRefMap");
+    check(map[n1] == 'B' && map('B') == n1 && map.inverse()['B'] == n1,
+          "Wrong CrossRefMap");
+    check(map[n2] == 'C' && map('C') == n2 && map.inverse()['C'] == n2,
+          "Wrong CrossRefMap");
+    check(map.count('A') == 1 && map.count('B') == 1 && map.count('C') == 1,
+          "Wrong CrossRefMap::count()");
+    
+    ValueIt it = map.beginValue();
+    check(*it++ == 'A' && *it++ == 'B' && *it++ == 'C' &&
+          it == map.endValue(), "Wrong value iterator");
+    
     map.set(n2, 'A');
+
+    check(map[n0] == 'A' && map[n1] == 'B' && map[n2] == 'A',
+          "Wrong CrossRefMap");
+    check(map('A') == n0 && map.inverse()['A'] == n0, "Wrong CrossRefMap");
+    check(map('B') == n1 && map.inverse()['B'] == n1, "Wrong CrossRefMap");
+    check(map('C') == INVALID && map.inverse()['C'] == INVALID,
+          "Wrong CrossRefMap");
+    check(map.count('A') == 2 && map.count('B') == 1 && map.count('C') == 0,
+          "Wrong CrossRefMap::count()");
+
+    it = map.beginValue();
+    check(*it++ == 'A' && *it++ == 'A' && *it++ == 'B' &&
+          it == map.endValue(), "Wrong value iterator");
+
     map.set(n0, 'C');
 
@@ -379,197 +487,12 @@
     check(map('B') == n1 && map.inverse()['B'] == n1, "Wrong CrossRefMap");
     check(map('C') == n0 && map.inverse()['C'] == n0, "Wrong CrossRefMap");
-
-    ValueIt it = map.beginValue();
+    check(map.count('A') == 1 && map.count('B') == 1 && map.count('C') == 1,
+          "Wrong CrossRefMap::count()");
+
+    it = map.beginValue();
     check(*it++ == 'A' && *it++ == 'B' && *it++ == 'C' &&
           it == map.endValue(), "Wrong value iterator");
   }
-  
-  // Iterable bool map
-  {
-    typedef SmartGraph Graph;
-    typedef SmartGraph::Node Item;
-
-    typedef IterableBoolMap<SmartGraph, SmartGraph::Node> Ibm;
-    checkConcept<ReferenceMap<Item, bool, bool&, const bool&>, Ibm>();
-
-    const int num = 10;
-    Graph g;
-    std::vector<Item> items;
-    for (int i = 0; i < num; ++i) {
-      items.push_back(g.addNode());
-    }
-
-    Ibm map1(g, true);
-    int n = 0;
-    for (Ibm::TrueIt it(map1); it != INVALID; ++it) {
-      check(map1[static_cast<Item>(it)], "Wrong TrueIt");
-      ++n;
-    }
-    check(n == num, "Wrong number");
-
-    n = 0;
-    for (Ibm::ItemIt it(map1, true); it != INVALID; ++it) {
-        check(map1[static_cast<Item>(it)], "Wrong ItemIt for true");
-        ++n;
-    }
-    check(n == num, "Wrong number");
-    check(Ibm::FalseIt(map1) == INVALID, "Wrong FalseIt");
-    check(Ibm::ItemIt(map1, false) == INVALID, "Wrong ItemIt for false");
-
-    map1[items[5]] = true;
-
-    n = 0;
-    for (Ibm::ItemIt it(map1, true); it != INVALID; ++it) {
-        check(map1[static_cast<Item>(it)], "Wrong ItemIt for true");
-        ++n;
-    }
-    check(n == num, "Wrong number");
-
-    map1[items[num / 2]] = false;
-    check(map1[items[num / 2]] == false, "Wrong map value");
-
-    n = 0;
-    for (Ibm::TrueIt it(map1); it != INVALID; ++it) {
-        check(map1[static_cast<Item>(it)], "Wrong TrueIt for true");
-        ++n;
-    }
-    check(n == num - 1, "Wrong number");
-
-    n = 0;
-    for (Ibm::FalseIt it(map1); it != INVALID; ++it) {
-        check(!map1[static_cast<Item>(it)], "Wrong FalseIt for true");
-        ++n;
-    }
-    check(n == 1, "Wrong number");
-
-    map1[items[0]] = false;
-    check(map1[items[0]] == false, "Wrong map value");
-
-    map1[items[num - 1]] = false;
-    check(map1[items[num - 1]] == false, "Wrong map value");
-
-    n = 0;
-    for (Ibm::TrueIt it(map1); it != INVALID; ++it) {
-        check(map1[static_cast<Item>(it)], "Wrong TrueIt for true");
-        ++n;
-    }
-    check(n == num - 3, "Wrong number");
-    check(map1.trueNum() == num - 3, "Wrong number");
-
-    n = 0;
-    for (Ibm::FalseIt it(map1); it != INVALID; ++it) {
-        check(!map1[static_cast<Item>(it)], "Wrong FalseIt for true");
-        ++n;
-    }
-    check(n == 3, "Wrong number");
-    check(map1.falseNum() == 3, "Wrong number");
-  }
-
-  // Iterable int map
-  {
-    typedef SmartGraph Graph;
-    typedef SmartGraph::Node Item;
-    typedef IterableIntMap<SmartGraph, SmartGraph::Node> Iim;
-
-    checkConcept<ReferenceMap<Item, int, int&, const int&>, Iim>();
-
-    const int num = 10;
-    Graph g;
-    std::vector<Item> items;
-    for (int i = 0; i < num; ++i) {
-      items.push_back(g.addNode());
-    }
-
-    Iim map1(g);
-    check(map1.size() == 0, "Wrong size");
-
-    for (int i = 0; i < num; ++i) {
-      map1[items[i]] = i;
-    }
-    check(map1.size() == num, "Wrong size");
-
-    for (int i = 0; i < num; ++i) {
-      Iim::ItemIt it(map1, i);
-      check(static_cast<Item>(it) == items[i], "Wrong value");
-      ++it;
-      check(static_cast<Item>(it) == INVALID, "Wrong value");
-    }
-
-    for (int i = 0; i < num; ++i) {
-      map1[items[i]] = i % 2;
-    }
-    check(map1.size() == 2, "Wrong size");
-
-    int n = 0;
-    for (Iim::ItemIt it(map1, 0); it != INVALID; ++it) {
-      check(map1[static_cast<Item>(it)] == 0, "Wrong value");
-      ++n;
-    }
-    check(n == (num + 1) / 2, "Wrong number");
-
-    for (Iim::ItemIt it(map1, 1); it != INVALID; ++it) {
-      check(map1[static_cast<Item>(it)] == 1, "Wrong value");
-      ++n;
-    }
-    check(n == num, "Wrong number");
-
-  }
-
-  // Iterable value map
-  {
-    typedef SmartGraph Graph;
-    typedef SmartGraph::Node Item;
-    typedef IterableValueMap<SmartGraph, SmartGraph::Node, double> Ivm;
-
-    checkConcept<ReadWriteMap<Item, double>, Ivm>();
-
-    const int num = 10;
-    Graph g;
-    std::vector<Item> items;
-    for (int i = 0; i < num; ++i) {
-      items.push_back(g.addNode());
-    }
-
-    Ivm map1(g, 0.0);
-    check(distance(map1.beginValue(), map1.endValue()) == 1, "Wrong size");
-    check(*map1.beginValue() == 0.0, "Wrong value");
-
-    for (int i = 0; i < num; ++i) {
-      map1.set(items[i], static_cast<double>(i));
-    }
-    check(distance(map1.beginValue(), map1.endValue()) == num, "Wrong size");
-
-    for (int i = 0; i < num; ++i) {
-      Ivm::ItemIt it(map1, static_cast<double>(i));
-      check(static_cast<Item>(it) == items[i], "Wrong value");
-      ++it;
-      check(static_cast<Item>(it) == INVALID, "Wrong value");
-    }
-
-    for (Ivm::ValueIterator vit = map1.beginValue();
-         vit != map1.endValue(); ++vit) {
-      check(map1[static_cast<Item>(Ivm::ItemIt(map1, *vit))] == *vit,
-            "Wrong ValueIterator");
-    }
-
-    for (int i = 0; i < num; ++i) {
-      map1.set(items[i], static_cast<double>(i % 2));
-    }
-    check(distance(map1.beginValue(), map1.endValue()) == 2, "Wrong size");
-
-    int n = 0;
-    for (Ivm::ItemIt it(map1, 0.0); it != INVALID; ++it) {
-      check(map1[static_cast<Item>(it)] == 0.0, "Wrong value");
-      ++n;
-    }
-    check(n == (num + 1) / 2, "Wrong number");
-
-    for (Ivm::ItemIt it(map1, 1.0); it != INVALID; ++it) {
-      check(map1[static_cast<Item>(it)] == 1.0, "Wrong value");
-      ++n;
-    }
-    check(n == num, "Wrong number");
-
-  }
+
   return 0;
 }
