Index: lemon/adaptors.h
===================================================================
--- lemon/adaptors.h	(revision 464)
+++ lemon/adaptors.h	(revision 512)
@@ -37,21 +37,26 @@
 namespace lemon {
 
-  template<typename _Digraph>
+#ifdef _MSC_VER
+#define LEMON_SCOPE_FIX(OUTER, NESTED) OUTER::NESTED
+#else
+#define LEMON_SCOPE_FIX(OUTER, NESTED) typename OUTER::template NESTED
+#endif
+
+  template<typename DGR>
   class DigraphAdaptorBase {
   public:
-    typedef _Digraph Digraph;
+    typedef DGR Digraph;
     typedef DigraphAdaptorBase Adaptor;
-    typedef Digraph ParentDigraph;
 
   protected:
-    Digraph* _digraph;
+    DGR* _digraph;
     DigraphAdaptorBase() : _digraph(0) { }
-    void setDigraph(Digraph& digraph) { _digraph = &digraph; }
-
-  public:
-    DigraphAdaptorBase(Digraph& digraph) : _digraph(&digraph) { }
-
-    typedef typename Digraph::Node Node;
-    typedef typename Digraph::Arc Arc;
+    void initialize(DGR& digraph) { _digraph = &digraph; }
+
+  public:
+    DigraphAdaptorBase(DGR& digraph) : _digraph(&digraph) { }
+
+    typedef typename DGR::Node Node;
+    typedef typename DGR::Arc Arc;
 
     void first(Node& i) const { _digraph->first(i); }
@@ -68,11 +73,11 @@
     Node target(const Arc& a) const { return _digraph->target(a); }
 
-    typedef NodeNumTagIndicator<Digraph> NodeNumTag;
+    typedef NodeNumTagIndicator<DGR> NodeNumTag;
     int nodeNum() const { return _digraph->nodeNum(); }
 
-    typedef ArcNumTagIndicator<Digraph> ArcNumTag;
+    typedef ArcNumTagIndicator<DGR> ArcNumTag;
     int arcNum() const { return _digraph->arcNum(); }
 
-    typedef FindArcTagIndicator<Digraph> FindArcTag;
+    typedef FindArcTagIndicator<DGR> FindArcTag;
     Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) const {
       return _digraph->findArc(u, v, prev);
@@ -96,20 +101,20 @@
     int maxArcId() const { return _digraph->maxArcId(); }
 
-    typedef typename ItemSetTraits<Digraph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier;
     NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
 
-    typedef typename ItemSetTraits<Digraph, Arc>::ItemNotifier ArcNotifier;
+    typedef typename ItemSetTraits<DGR, Arc>::ItemNotifier ArcNotifier;
     ArcNotifier& notifier(Arc) const { return _digraph->notifier(Arc()); }
 
-    template <typename _Value>
-    class NodeMap : public Digraph::template NodeMap<_Value> {
+    template <typename V>
+    class NodeMap : public DGR::template NodeMap<V> {
     public:
 
-      typedef typename Digraph::template NodeMap<_Value> Parent;
+      typedef typename DGR::template NodeMap<V> Parent;
 
       explicit NodeMap(const Adaptor& adaptor)
         : Parent(*adaptor._digraph) {}
 
-      NodeMap(const Adaptor& adaptor, const _Value& value)
+      NodeMap(const Adaptor& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) { }
 
@@ -127,14 +132,14 @@
     };
 
-    template <typename _Value>
-    class ArcMap : public Digraph::template ArcMap<_Value> {
+    template <typename V>
+    class ArcMap : public DGR::template ArcMap<V> {
     public:
 
-      typedef typename Digraph::template ArcMap<_Value> Parent;
-
-      explicit ArcMap(const Adaptor& adaptor)
+      typedef typename DGR::template ArcMap<V> Parent;
+
+      explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor)
         : Parent(*adaptor._digraph) {}
 
-      ArcMap(const Adaptor& adaptor, const _Value& value)
+      ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) {}
 
@@ -154,23 +159,22 @@
   };
 
-  template<typename _Graph>
+  template<typename GR>
   class GraphAdaptorBase {
   public:
-    typedef _Graph Graph;
-    typedef Graph ParentGraph;
+    typedef GR Graph;
 
   protected:
-    Graph* _graph;
+    GR* _graph;
 
     GraphAdaptorBase() : _graph(0) {}
 
-    void setGraph(Graph& graph) { _graph = &graph; }
-
-  public:
-    GraphAdaptorBase(Graph& graph) : _graph(&graph) {}
-
-    typedef typename Graph::Node Node;
-    typedef typename Graph::Arc Arc;
-    typedef typename Graph::Edge Edge;
+    void initialize(GR& graph) { _graph = &graph; }
+
+  public:
+    GraphAdaptorBase(GR& graph) : _graph(&graph) {}
+
+    typedef typename GR::Node Node;
+    typedef typename GR::Arc Arc;
+    typedef typename GR::Edge Edge;
 
     void first(Node& i) const { _graph->first(i); }
@@ -240,20 +244,20 @@
     int maxEdgeId() const { return _graph->maxEdgeId(); }
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
     NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
 
-    typedef typename ItemSetTraits<Graph, Arc>::ItemNotifier ArcNotifier;
+    typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier;
     ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
 
-    typedef typename ItemSetTraits<Graph, Edge>::ItemNotifier EdgeNotifier;
+    typedef typename ItemSetTraits<GR, Edge>::ItemNotifier EdgeNotifier;
     EdgeNotifier& notifier(Edge) const { return _graph->notifier(Edge()); }
 
-    template <typename _Value>
-    class NodeMap : public Graph::template NodeMap<_Value> {
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
-      typedef typename Graph::template NodeMap<_Value> Parent;
-      explicit NodeMap(const GraphAdaptorBase<Graph>& adapter)
+      typedef typename GR::template NodeMap<V> Parent;
+      explicit NodeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
-      NodeMap(const GraphAdaptorBase<Graph>& adapter, const _Value& value)
+      NodeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
         : Parent(*adapter._graph, value) {}
 
@@ -271,11 +275,11 @@
     };
 
-    template <typename _Value>
-    class ArcMap : public Graph::template ArcMap<_Value> {
+    template <typename V>
+    class ArcMap : public GR::template ArcMap<V> {
     public:
-      typedef typename Graph::template ArcMap<_Value> Parent;
-      explicit ArcMap(const GraphAdaptorBase<Graph>& adapter)
+      typedef typename GR::template ArcMap<V> Parent;
+      explicit ArcMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
-      ArcMap(const GraphAdaptorBase<Graph>& adapter, const _Value& value)
+      ArcMap(const GraphAdaptorBase<GR>& adapter, const V& value)
         : Parent(*adapter._graph, value) {}
 
@@ -292,11 +296,11 @@
     };
 
-    template <typename _Value>
-    class EdgeMap : public Graph::template EdgeMap<_Value> {
+    template <typename V>
+    class EdgeMap : public GR::template EdgeMap<V> {
     public:
-      typedef typename Graph::template EdgeMap<_Value> Parent;
-      explicit EdgeMap(const GraphAdaptorBase<Graph>& adapter)
+      typedef typename GR::template EdgeMap<V> Parent;
+      explicit EdgeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
-      EdgeMap(const GraphAdaptorBase<Graph>& adapter, const _Value& value)
+      EdgeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
         : Parent(*adapter._graph, value) {}
 
@@ -315,9 +319,9 @@
   };
 
-  template <typename _Digraph>
-  class ReverseDigraphBase : public DigraphAdaptorBase<_Digraph> {
-  public:
-    typedef _Digraph Digraph;
-    typedef DigraphAdaptorBase<_Digraph> Parent;
+  template <typename DGR>
+  class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
+  public:
+    typedef DGR Digraph;
+    typedef DigraphAdaptorBase<DGR> Parent;
   protected:
     ReverseDigraphBase() : Parent() { }
@@ -337,5 +341,5 @@
     Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); }
 
-    typedef FindArcTagIndicator<Digraph> FindArcTag;
+    typedef FindArcTagIndicator<DGR> FindArcTag;
     Arc findArc(const Node& u, const Node& v,
                 const Arc& prev = INVALID) const {
@@ -357,5 +361,5 @@
   /// parameter is set to be \c const.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It can also be specified to be \c const.
@@ -363,15 +367,15 @@
   /// \note The \c Node and \c Arc types of this adaptor and the adapted
   /// digraph are convertible to each other.
-  template<typename GR>
+  template<typename DGR>
 #ifdef DOXYGEN
   class ReverseDigraph {
 #else
   class ReverseDigraph :
-    public DigraphAdaptorExtender<ReverseDigraphBase<GR> > {
+    public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
 #endif
   public:
     /// The type of the adapted digraph.
-    typedef GR Digraph;
-    typedef DigraphAdaptorExtender<ReverseDigraphBase<GR> > Parent;
+    typedef DGR Digraph;
+    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
   protected:
     ReverseDigraph() { }
@@ -381,6 +385,6 @@
     ///
     /// Creates a reverse digraph adaptor for the given digraph.
-    explicit ReverseDigraph(Digraph& digraph) {
-      Parent::setDigraph(digraph);
+    explicit ReverseDigraph(DGR& digraph) {
+      Parent::initialize(digraph);
     }
   };
@@ -391,31 +395,29 @@
   /// \ingroup graph_adaptors
   /// \relates ReverseDigraph
-  template<typename GR>
-  ReverseDigraph<const GR> reverseDigraph(const GR& digraph) {
-    return ReverseDigraph<const GR>(digraph);
+  template<typename DGR>
+  ReverseDigraph<const DGR> reverseDigraph(const DGR& digraph) {
+    return ReverseDigraph<const DGR>(digraph);
   }
 
 
-  template <typename _Digraph, typename _NodeFilterMap,
-            typename _ArcFilterMap, bool _checked = true>
-  class SubDigraphBase : public DigraphAdaptorBase<_Digraph> {
-  public:
-    typedef _Digraph Digraph;
-    typedef _NodeFilterMap NodeFilterMap;
-    typedef _ArcFilterMap ArcFilterMap;
+  template <typename DGR, typename NF, typename AF, bool ch = true>
+  class SubDigraphBase : public DigraphAdaptorBase<DGR> {
+  public:
+    typedef DGR Digraph;
+    typedef NF NodeFilterMap;
+    typedef AF ArcFilterMap;
 
     typedef SubDigraphBase Adaptor;
-    typedef DigraphAdaptorBase<_Digraph> Parent;
+    typedef DigraphAdaptorBase<DGR> Parent;
   protected:
-    NodeFilterMap* _node_filter;
-    ArcFilterMap* _arc_filter;
+    NF* _node_filter;
+    AF* _arc_filter;
     SubDigraphBase()
       : Parent(), _node_filter(0), _arc_filter(0) { }
 
-    void setNodeFilterMap(NodeFilterMap& node_filter) {
+    void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
+      Parent::initialize(digraph);
       _node_filter = &node_filter;
-    }
-    void setArcFilterMap(ArcFilterMap& arc_filter) {
-      _arc_filter = &arc_filter;
+      _arc_filter = &arc_filter;      
     }
 
@@ -488,5 +490,5 @@
     typedef False ArcNumTag;
 
-    typedef FindArcTagIndicator<Digraph> FindArcTag;
+    typedef FindArcTagIndicator<DGR> FindArcTag;
     Arc findArc(const Node& source, const Node& target,
                 const Arc& prev = INVALID) const {
@@ -501,16 +503,19 @@
     }
 
-    template <typename _Value>
-    class NodeMap : public SubMapExtender<Adaptor,
-      typename Parent::template NodeMap<_Value> > {
+  public:
+
+    template <typename V>
+    class NodeMap 
+      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
+	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template NodeMap<Value> > MapParent;
-
-      NodeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      NodeMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+	    LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
+
+      NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
+        : Parent(adaptor) {}
+      NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -521,21 +526,22 @@
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class ArcMap : public SubMapExtender<Adaptor,
-      typename Parent::template ArcMap<_Value> > {
+    template <typename V>
+    class ArcMap 
+      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template ArcMap<Value> > MapParent;
-
-      ArcMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      ArcMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
+
+      ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
+        : Parent(adaptor) {}
+      ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -546,5 +552,5 @@
       template <typename CMap>
       ArcMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
@@ -553,25 +559,24 @@
   };
 
-  template <typename _Digraph, typename _NodeFilterMap, typename _ArcFilterMap>
-  class SubDigraphBase<_Digraph, _NodeFilterMap, _ArcFilterMap, false>
-    : public DigraphAdaptorBase<_Digraph> {
-  public:
-    typedef _Digraph Digraph;
-    typedef _NodeFilterMap NodeFilterMap;
-    typedef _ArcFilterMap ArcFilterMap;
+  template <typename DGR, typename NF, typename AF>
+  class SubDigraphBase<DGR, NF, AF, false>
+    : public DigraphAdaptorBase<DGR> {
+  public:
+    typedef DGR Digraph;
+    typedef NF NodeFilterMap;
+    typedef AF ArcFilterMap;
 
     typedef SubDigraphBase Adaptor;
     typedef DigraphAdaptorBase<Digraph> Parent;
   protected:
-    NodeFilterMap* _node_filter;
-    ArcFilterMap* _arc_filter;
+    NF* _node_filter;
+    AF* _arc_filter;
     SubDigraphBase()
       : Parent(), _node_filter(0), _arc_filter(0) { }
 
-    void setNodeFilterMap(NodeFilterMap& node_filter) {
+    void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
+      Parent::initialize(digraph);
       _node_filter = &node_filter;
-    }
-    void setArcFilterMap(ArcFilterMap& arc_filter) {
-      _arc_filter = &arc_filter;
+      _arc_filter = &arc_filter;      
     }
 
@@ -628,5 +633,5 @@
     typedef False ArcNumTag;
 
-    typedef FindArcTagIndicator<Digraph> FindArcTag;
+    typedef FindArcTagIndicator<DGR> FindArcTag;
     Arc findArc(const Node& source, const Node& target,
                 const Arc& prev = INVALID) const {
@@ -641,16 +646,17 @@
     }
 
-    template <typename _Value>
-    class NodeMap : public SubMapExtender<Adaptor,
-      typename Parent::template NodeMap<_Value> > {
+    template <typename V>
+    class NodeMap 
+      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
+          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template NodeMap<Value> > MapParent;
-
-      NodeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      NodeMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
+        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
+
+      NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
+        : Parent(adaptor) {}
+      NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -661,21 +667,22 @@
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class ArcMap : public SubMapExtender<Adaptor,
-      typename Parent::template ArcMap<_Value> > {
+    template <typename V>
+    class ArcMap 
+      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
+          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template ArcMap<Value> > MapParent;
-
-      ArcMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      ArcMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
+          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
+
+      ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
+        : Parent(adaptor) {}
+      ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -686,5 +693,5 @@
       template <typename CMap>
       ArcMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
@@ -709,5 +716,5 @@
   /// parameter is set to be \c const.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It can also be specified to be \c const.
@@ -715,9 +722,9 @@
   /// It must be a \c bool (or convertible) node map of the
   /// adapted digraph. The default type is
-  /// \ref concepts::Digraph::NodeMap "GR::NodeMap<bool>".
+  /// \ref concepts::Digraph::NodeMap "DGR::NodeMap<bool>".
   /// \tparam AF The type of the arc filter map.
   /// It must be \c bool (or convertible) arc map of the
   /// adapted digraph. The default type is
-  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
+  /// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>".
   ///
   /// \note The \c Node and \c Arc types of this adaptor and the adapted
@@ -727,16 +734,16 @@
   /// \see FilterArcs
 #ifdef DOXYGEN
-  template<typename GR, typename NF, typename AF>
+  template<typename DGR, typename NF, typename AF>
   class SubDigraph {
 #else
-  template<typename GR,
-           typename NF = typename GR::template NodeMap<bool>,
-           typename AF = typename GR::template ArcMap<bool> >
+  template<typename DGR,
+           typename NF = typename DGR::template NodeMap<bool>,
+           typename AF = typename DGR::template ArcMap<bool> >
   class SubDigraph :
-    public DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> > {
+    public DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> > {
 #endif
   public:
     /// The type of the adapted digraph.
-    typedef GR Digraph;
+    typedef DGR Digraph;
     /// The type of the node filter map.
     typedef NF NodeFilterMap;
@@ -744,5 +751,5 @@
     typedef AF ArcFilterMap;
 
-    typedef DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> >
+    typedef DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> >
       Parent;
 
@@ -758,9 +765,6 @@
     /// Creates a subdigraph for the given digraph with the
     /// given node and arc filter maps.
-    SubDigraph(Digraph& digraph, NodeFilterMap& node_filter,
-               ArcFilterMap& arc_filter) {
-      setDigraph(digraph);
-      setNodeFilterMap(node_filter);
-      setArcFilterMap(arc_filter);
+    SubDigraph(DGR& digraph, NF& node_filter, AF& arc_filter) {
+      Parent::initialize(digraph, node_filter, arc_filter);
     }
 
@@ -824,60 +828,58 @@
   /// \ingroup graph_adaptors
   /// \relates SubDigraph
-  template<typename GR, typename NF, typename AF>
-  SubDigraph<const GR, NF, AF>
-  subDigraph(const GR& digraph,
-             NF& node_filter_map, AF& arc_filter_map) {
-    return SubDigraph<const GR, NF, AF>
-      (digraph, node_filter_map, arc_filter_map);
+  template<typename DGR, typename NF, typename AF>
+  SubDigraph<const DGR, NF, AF>
+  subDigraph(const DGR& digraph,
+             NF& node_filter, AF& arc_filter) {
+    return SubDigraph<const DGR, NF, AF>
+      (digraph, node_filter, arc_filter);
   }
 
-  template<typename GR, typename NF, typename AF>
-  SubDigraph<const GR, const NF, AF>
-  subDigraph(const GR& digraph,
-             const NF& node_filter_map, AF& arc_filter_map) {
-    return SubDigraph<const GR, const NF, AF>
-      (digraph, node_filter_map, arc_filter_map);
+  template<typename DGR, typename NF, typename AF>
+  SubDigraph<const DGR, const NF, AF>
+  subDigraph(const DGR& digraph,
+             const NF& node_filter, AF& arc_filter) {
+    return SubDigraph<const DGR, const NF, AF>
+      (digraph, node_filter, arc_filter);
   }
 
-  template<typename GR, typename NF, typename AF>
-  SubDigraph<const GR, NF, const AF>
-  subDigraph(const GR& digraph,
-             NF& node_filter_map, const AF& arc_filter_map) {
-    return SubDigraph<const GR, NF, const AF>
-      (digraph, node_filter_map, arc_filter_map);
+  template<typename DGR, typename NF, typename AF>
+  SubDigraph<const DGR, NF, const AF>
+  subDigraph(const DGR& digraph,
+             NF& node_filter, const AF& arc_filter) {
+    return SubDigraph<const DGR, NF, const AF>
+      (digraph, node_filter, arc_filter);
   }
 
-  template<typename GR, typename NF, typename AF>
-  SubDigraph<const GR, const NF, const AF>
-  subDigraph(const GR& digraph,
-             const NF& node_filter_map, const AF& arc_filter_map) {
-    return SubDigraph<const GR, const NF, const AF>
-      (digraph, node_filter_map, arc_filter_map);
+  template<typename DGR, typename NF, typename AF>
+  SubDigraph<const DGR, const NF, const AF>
+  subDigraph(const DGR& digraph,
+             const NF& node_filter, const AF& arc_filter) {
+    return SubDigraph<const DGR, const NF, const AF>
+      (digraph, node_filter, arc_filter);
   }
 
 
-  template <typename _Graph, typename _NodeFilterMap,
-            typename _EdgeFilterMap, bool _checked = true>
-  class SubGraphBase : public GraphAdaptorBase<_Graph> {
-  public:
-    typedef _Graph Graph;
-    typedef _NodeFilterMap NodeFilterMap;
-    typedef _EdgeFilterMap EdgeFilterMap;
+  template <typename GR, typename NF, typename EF, bool ch = true>
+  class SubGraphBase : public GraphAdaptorBase<GR> {
+  public:
+    typedef GR Graph;
+    typedef NF NodeFilterMap;
+    typedef EF EdgeFilterMap;
 
     typedef SubGraphBase Adaptor;
-    typedef GraphAdaptorBase<_Graph> Parent;
+    typedef GraphAdaptorBase<GR> Parent;
   protected:
 
-    NodeFilterMap* _node_filter_map;
-    EdgeFilterMap* _edge_filter_map;
+    NF* _node_filter;
+    EF* _edge_filter;
 
     SubGraphBase()
-      : Parent(), _node_filter_map(0), _edge_filter_map(0) { }
-
-    void setNodeFilterMap(NodeFilterMap& node_filter_map) {
-      _node_filter_map=&node_filter_map;
-    }
-    void setEdgeFilterMap(EdgeFilterMap& edge_filter_map) {
-      _edge_filter_map=&edge_filter_map;
+      : Parent(), _node_filter(0), _edge_filter(0) { }
+
+    void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
+      Parent::initialize(graph);
+      _node_filter = &node_filter;
+      _edge_filter = &edge_filter;
     }
 
@@ -890,12 +892,12 @@
     void first(Node& i) const {
       Parent::first(i);
-      while (i!=INVALID && !(*_node_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
     }
 
     void first(Arc& i) const {
       Parent::first(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::source(i)]
-                            || !(*_node_filter_map)[Parent::target(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::source(i)]
+                            || !(*_node_filter)[Parent::target(i)]))
         Parent::next(i);
     }
@@ -903,7 +905,7 @@
     void first(Edge& i) const {
       Parent::first(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::u(i)]
-                            || !(*_node_filter_map)[Parent::v(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::u(i)]
+                            || !(*_node_filter)[Parent::v(i)]))
         Parent::next(i);
     }
@@ -911,6 +913,6 @@
     void firstIn(Arc& i, const Node& n) const {
       Parent::firstIn(i, n);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::source(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::source(i)]))
         Parent::nextIn(i);
     }
@@ -918,6 +920,6 @@
     void firstOut(Arc& i, const Node& n) const {
       Parent::firstOut(i, n);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::target(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::target(i)]))
         Parent::nextOut(i);
     }
@@ -925,7 +927,7 @@
     void firstInc(Edge& i, bool& d, const Node& n) const {
       Parent::firstInc(i, d, n);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::u(i)]
-                            || !(*_node_filter_map)[Parent::v(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::u(i)]
+                            || !(*_node_filter)[Parent::v(i)]))
         Parent::nextInc(i, d);
     }
@@ -933,12 +935,12 @@
     void next(Node& i) const {
       Parent::next(i);
-      while (i!=INVALID && !(*_node_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
     }
 
     void next(Arc& i) const {
       Parent::next(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::source(i)]
-                            || !(*_node_filter_map)[Parent::target(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::source(i)]
+                            || !(*_node_filter)[Parent::target(i)]))
         Parent::next(i);
     }
@@ -946,7 +948,7 @@
     void next(Edge& i) const {
       Parent::next(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::u(i)]
-                            || !(*_node_filter_map)[Parent::v(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::u(i)]
+                            || !(*_node_filter)[Parent::v(i)]))
         Parent::next(i);
     }
@@ -954,6 +956,6 @@
     void nextIn(Arc& i) const {
       Parent::nextIn(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::source(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::source(i)]))
         Parent::nextIn(i);
     }
@@ -961,6 +963,6 @@
     void nextOut(Arc& i) const {
       Parent::nextOut(i);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::target(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::target(i)]))
         Parent::nextOut(i);
     }
@@ -968,15 +970,15 @@
     void nextInc(Edge& i, bool& d) const {
       Parent::nextInc(i, d);
-      while (i!=INVALID && (!(*_edge_filter_map)[i]
-                            || !(*_node_filter_map)[Parent::u(i)]
-                            || !(*_node_filter_map)[Parent::v(i)]))
+      while (i!=INVALID && (!(*_edge_filter)[i]
+                            || !(*_node_filter)[Parent::u(i)]
+                            || !(*_node_filter)[Parent::v(i)]))
         Parent::nextInc(i, d);
     }
 
-    void status(const Node& n, bool v) const { _node_filter_map->set(n, v); }
-    void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); }
-
-    bool status(const Node& n) const { return (*_node_filter_map)[n]; }
-    bool status(const Edge& e) const { return (*_edge_filter_map)[e]; }
+    void status(const Node& n, bool v) const { _node_filter->set(n, v); }
+    void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
+
+    bool status(const Node& n) const { return (*_node_filter)[n]; }
+    bool status(const Edge& e) const { return (*_edge_filter)[e]; }
 
     typedef False NodeNumTag;
@@ -987,9 +989,9 @@
     Arc findArc(const Node& u, const Node& v,
                 const Arc& prev = INVALID) const {
-      if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
+      if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
         return INVALID;
       }
       Arc arc = Parent::findArc(u, v, prev);
-      while (arc != INVALID && !(*_edge_filter_map)[arc]) {
+      while (arc != INVALID && !(*_edge_filter)[arc]) {
         arc = Parent::findArc(u, v, arc);
       }
@@ -1000,9 +1002,9 @@
     Edge findEdge(const Node& u, const Node& v,
                   const Edge& prev = INVALID) const {
-      if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
+      if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
         return INVALID;
       }
       Edge edge = Parent::findEdge(u, v, prev);
-      while (edge != INVALID && !(*_edge_filter_map)[edge]) {
+      while (edge != INVALID && !(*_edge_filter)[edge]) {
         edge = Parent::findEdge(u, v, edge);
       }
@@ -1010,16 +1012,17 @@
     }
 
-    template <typename _Value>
-    class NodeMap : public SubMapExtender<Adaptor,
-      typename Parent::template NodeMap<_Value> > {
+    template <typename V>
+    class NodeMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
+          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template NodeMap<Value> > MapParent;
-
-      NodeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      NodeMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
+
+      NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
+        : Parent(adaptor) {}
+      NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1030,21 +1033,22 @@
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class ArcMap : public SubMapExtender<Adaptor,
-      typename Parent::template ArcMap<_Value> > {
+    template <typename V>
+    class ArcMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
+          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template ArcMap<Value> > MapParent;
-
-      ArcMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      ArcMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
+
+      ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
+        : Parent(adaptor) {}
+      ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1055,22 +1059,23 @@
       template <typename CMap>
       ArcMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class EdgeMap : public SubMapExtender<Adaptor,
-      typename Parent::template EdgeMap<_Value> > {
+    template <typename V>
+    class EdgeMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template EdgeMap<Value> > MapParent;
-
-      EdgeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-
-      EdgeMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
+
+      EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
+        : Parent(adaptor) {}
+
+      EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1081,5 +1086,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
@@ -1088,25 +1093,24 @@
   };
 
-  template <typename _Graph, typename _NodeFilterMap, typename _EdgeFilterMap>
-  class SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, false>
-    : public GraphAdaptorBase<_Graph> {
-  public:
-    typedef _Graph Graph;
-    typedef _NodeFilterMap NodeFilterMap;
-    typedef _EdgeFilterMap EdgeFilterMap;
+  template <typename GR, typename NF, typename EF>
+  class SubGraphBase<GR, NF, EF, false>
+    : public GraphAdaptorBase<GR> {
+  public:
+    typedef GR Graph;
+    typedef NF NodeFilterMap;
+    typedef EF EdgeFilterMap;
 
     typedef SubGraphBase Adaptor;
-    typedef GraphAdaptorBase<_Graph> Parent;
+    typedef GraphAdaptorBase<GR> Parent;
   protected:
-    NodeFilterMap* _node_filter_map;
-    EdgeFilterMap* _edge_filter_map;
-    SubGraphBase() : Parent(),
-                     _node_filter_map(0), _edge_filter_map(0) { }
-
-    void setNodeFilterMap(NodeFilterMap& node_filter_map) {
-      _node_filter_map=&node_filter_map;
-    }
-    void setEdgeFilterMap(EdgeFilterMap& edge_filter_map) {
-      _edge_filter_map=&edge_filter_map;
+    NF* _node_filter;
+    EF* _edge_filter;
+    SubGraphBase() 
+	  : Parent(), _node_filter(0), _edge_filter(0) { }
+
+    void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
+      Parent::initialize(graph);
+      _node_filter = &node_filter;
+      _edge_filter = &edge_filter;
     }
 
@@ -1119,63 +1123,63 @@
     void first(Node& i) const {
       Parent::first(i);
-      while (i!=INVALID && !(*_node_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
     }
 
     void first(Arc& i) const {
       Parent::first(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
     }
 
     void first(Edge& i) const {
       Parent::first(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
     }
 
     void firstIn(Arc& i, const Node& n) const {
       Parent::firstIn(i, n);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextIn(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i);
     }
 
     void firstOut(Arc& i, const Node& n) const {
       Parent::firstOut(i, n);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextOut(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i);
     }
 
     void firstInc(Edge& i, bool& d, const Node& n) const {
       Parent::firstInc(i, d, n);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextInc(i, d);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d);
     }
 
     void next(Node& i) const {
       Parent::next(i);
-      while (i!=INVALID && !(*_node_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
     }
     void next(Arc& i) const {
       Parent::next(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
     }
     void next(Edge& i) const {
       Parent::next(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::next(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
     }
     void nextIn(Arc& i) const {
       Parent::nextIn(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextIn(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i);
     }
 
     void nextOut(Arc& i) const {
       Parent::nextOut(i);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextOut(i);
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i);
     }
     void nextInc(Edge& i, bool& d) const {
       Parent::nextInc(i, d);
-      while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextInc(i, d);
-    }
-
-    void status(const Node& n, bool v) const { _node_filter_map->set(n, v); }
-    void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); }
-
-    bool status(const Node& n) const { return (*_node_filter_map)[n]; }
-    bool status(const Edge& e) const { return (*_edge_filter_map)[e]; }
+      while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d);
+    }
+
+    void status(const Node& n, bool v) const { _node_filter->set(n, v); }
+    void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
+
+    bool status(const Node& n) const { return (*_node_filter)[n]; }
+    bool status(const Edge& e) const { return (*_edge_filter)[e]; }
 
     typedef False NodeNumTag;
@@ -1187,5 +1191,5 @@
                 const Arc& prev = INVALID) const {
       Arc arc = Parent::findArc(u, v, prev);
-      while (arc != INVALID && !(*_edge_filter_map)[arc]) {
+      while (arc != INVALID && !(*_edge_filter)[arc]) {
         arc = Parent::findArc(u, v, arc);
       }
@@ -1197,5 +1201,5 @@
                   const Edge& prev = INVALID) const {
       Edge edge = Parent::findEdge(u, v, prev);
-      while (edge != INVALID && !(*_edge_filter_map)[edge]) {
+      while (edge != INVALID && !(*_edge_filter)[edge]) {
         edge = Parent::findEdge(u, v, edge);
       }
@@ -1203,16 +1207,17 @@
     }
 
-    template <typename _Value>
-    class NodeMap : public SubMapExtender<Adaptor,
-      typename Parent::template NodeMap<_Value> > {
+    template <typename V>
+    class NodeMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
+          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template NodeMap<Value> > MapParent;
-
-      NodeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      NodeMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
+
+      NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
+        : Parent(adaptor) {}
+      NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1223,21 +1228,22 @@
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class ArcMap : public SubMapExtender<Adaptor,
-      typename Parent::template ArcMap<_Value> > {
+    template <typename V>
+    class ArcMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
+          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template ArcMap<Value> > MapParent;
-
-      ArcMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-      ArcMap(const Adaptor& adaptor, const Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
+
+      ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
+        : Parent(adaptor) {}
+      ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1248,22 +1254,23 @@
       template <typename CMap>
       ArcMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
     };
 
-    template <typename _Value>
-    class EdgeMap : public SubMapExtender<Adaptor,
-      typename Parent::template EdgeMap<_Value> > {
+    template <typename V>
+    class EdgeMap 
+      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, typename Parent::
-                             template EdgeMap<Value> > MapParent;
-
-      EdgeMap(const Adaptor& adaptor)
-        : MapParent(adaptor) {}
-
-      EdgeMap(const Adaptor& adaptor, const _Value& value)
-        : MapParent(adaptor, value) {}
+      typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+		  LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
+
+      EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
+        : Parent(adaptor) {}
+
+      EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
+        : Parent(adaptor, value) {}
 
     private:
@@ -1274,5 +1281,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-        MapParent::operator=(cmap);
+        Parent::operator=(cmap);
         return *this;
       }
@@ -1333,5 +1340,5 @@
     typedef EF EdgeFilterMap;
 
-    typedef GraphAdaptorExtender< SubGraphBase<GR, NF, EF, true> >
+    typedef GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> >
       Parent;
 
@@ -1347,9 +1354,6 @@
     /// Creates a subgraph for the given graph with the given node
     /// and edge filter maps.
-    SubGraph(Graph& graph, NodeFilterMap& node_filter_map,
-             EdgeFilterMap& edge_filter_map) {
-      setGraph(graph);
-      setNodeFilterMap(node_filter_map);
-      setEdgeFilterMap(edge_filter_map);
+    SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
+      initialize(graph, node_filter, edge_filter);
     }
 
@@ -1415,32 +1419,28 @@
   template<typename GR, typename NF, typename EF>
   SubGraph<const GR, NF, EF>
-  subGraph(const GR& graph,
-           NF& node_filter_map, EF& edge_filter_map) {
+  subGraph(const GR& graph, NF& node_filter, EF& edge_filter) {
     return SubGraph<const GR, NF, EF>
-      (graph, node_filter_map, edge_filter_map);
+      (graph, node_filter, edge_filter);
   }
 
   template<typename GR, typename NF, typename EF>
   SubGraph<const GR, const NF, EF>
-  subGraph(const GR& graph,
-           const NF& node_filter_map, EF& edge_filter_map) {
+  subGraph(const GR& graph, const NF& node_filter, EF& edge_filter) {
     return SubGraph<const GR, const NF, EF>
-      (graph, node_filter_map, edge_filter_map);
+      (graph, node_filter, edge_filter);
   }
 
   template<typename GR, typename NF, typename EF>
   SubGraph<const GR, NF, const EF>
-  subGraph(const GR& graph,
-           NF& node_filter_map, const EF& edge_filter_map) {
+  subGraph(const GR& graph, NF& node_filter, const EF& edge_filter) {
     return SubGraph<const GR, NF, const EF>
-      (graph, node_filter_map, edge_filter_map);
+      (graph, node_filter, edge_filter);
   }
 
   template<typename GR, typename NF, typename EF>
   SubGraph<const GR, const NF, const EF>
-  subGraph(const GR& graph,
-           const NF& node_filter_map, const EF& edge_filter_map) {
+  subGraph(const GR& graph, const NF& node_filter, const EF& edge_filter) {
     return SubGraph<const GR, const NF, const EF>
-      (graph, node_filter_map, edge_filter_map);
+      (graph, node_filter, edge_filter);
   }
 
@@ -1482,5 +1482,6 @@
   class FilterNodes :
     public DigraphAdaptorExtender<
-      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> > {
+      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
+                     true> > {
 #endif
   public:
@@ -1490,15 +1491,13 @@
 
     typedef DigraphAdaptorExtender<
-      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> >
-      Parent;
+      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
+                     true> > Parent;
 
     typedef typename Parent::Node Node;
 
   protected:
-    ConstMap<typename Digraph::Arc, bool> const_true_map;
-
-    FilterNodes() : const_true_map(true) {
-      Parent::setArcFilterMap(const_true_map);
-    }
+    ConstMap<typename Digraph::Arc, Const<bool, true> > const_true_map;
+
+    FilterNodes() : const_true_map() {}
 
   public:
@@ -1508,10 +1507,8 @@
     /// Creates a subgraph for the given digraph or graph with the
     /// given node filter map.
-    FilterNodes(GR& graph, NodeFilterMap& node_filter) :
-      Parent(), const_true_map(true)
+    FilterNodes(GR& graph, NF& node_filter) 
+      : Parent(), const_true_map()
     {
-      Parent::setDigraph(graph);
-      Parent::setNodeFilterMap(node_filter);
-      Parent::setArcFilterMap(const_true_map);
+      Parent::initialize(graph, node_filter, const_true_map);
     }
 
@@ -1548,5 +1545,6 @@
                     typename enable_if<UndirectedTagIndicator<GR> >::type> :
     public GraphAdaptorExtender<
-      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> > {
+      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
+                   true> > {
 
   public:
@@ -1554,22 +1552,18 @@
     typedef NF NodeFilterMap;
     typedef GraphAdaptorExtender<
-      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> >
-      Parent;
+      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
+                   true> > Parent;
 
     typedef typename Parent::Node Node;
   protected:
-    ConstMap<typename Graph::Edge, bool> const_true_map;
-
-    FilterNodes() : const_true_map(true) {
-      Parent::setEdgeFilterMap(const_true_map);
-    }
-
-  public:
-
-    FilterNodes(Graph& _graph, NodeFilterMap& node_filter_map) :
-      Parent(), const_true_map(true) {
-      Parent::setGraph(_graph);
-      Parent::setNodeFilterMap(node_filter_map);
-      Parent::setEdgeFilterMap(const_true_map);
+    ConstMap<typename GR::Edge, Const<bool, true> > const_true_map;
+
+    FilterNodes() : const_true_map() {}
+
+  public:
+
+    FilterNodes(GR& graph, NodeFilterMap& node_filter) :
+      Parent(), const_true_map() {
+      Parent::initialize(graph, node_filter, const_true_map);
     }
 
@@ -1589,12 +1583,12 @@
   template<typename GR, typename NF>
   FilterNodes<const GR, NF>
-  filterNodes(const GR& graph, NF& node_filter_map) {
-    return FilterNodes<const GR, NF>(graph, node_filter_map);
+  filterNodes(const GR& graph, NF& node_filter) {
+    return FilterNodes<const GR, NF>(graph, node_filter);
   }
 
   template<typename GR, typename NF>
   FilterNodes<const GR, const NF>
-  filterNodes(const GR& graph, const NF& node_filter_map) {
-    return FilterNodes<const GR, const NF>(graph, node_filter_map);
+  filterNodes(const GR& graph, const NF& node_filter) {
+    return FilterNodes<const GR, const NF>(graph, node_filter);
   }
 
@@ -1613,5 +1607,5 @@
   /// parameter is set to be \c const.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It can also be specified to be \c const.
@@ -1619,37 +1613,36 @@
   /// It must be a \c bool (or convertible) arc map of the
   /// adapted digraph. The default type is
-  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
+  /// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>".
   ///
   /// \note The \c Node and \c Arc types of this adaptor and the adapted
   /// digraph are convertible to each other.
 #ifdef DOXYGEN
-  template<typename GR,
+  template<typename DGR,
            typename AF>
   class FilterArcs {
 #else
-  template<typename GR,
-           typename AF = typename GR::template ArcMap<bool> >
+  template<typename DGR,
+           typename AF = typename DGR::template ArcMap<bool> >
   class FilterArcs :
     public DigraphAdaptorExtender<
-      SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> > {
+      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
+                     AF, false> > {
 #endif
   public:
     /// The type of the adapted digraph.
-    typedef GR Digraph;
+    typedef DGR Digraph;
     /// The type of the arc filter map.
     typedef AF ArcFilterMap;
 
     typedef DigraphAdaptorExtender<
-      SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> >
-      Parent;
+      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
+                     AF, false> > Parent;
 
     typedef typename Parent::Arc Arc;
 
   protected:
-    ConstMap<typename Digraph::Node, bool> const_true_map;
-
-    FilterArcs() : const_true_map(true) {
-      Parent::setNodeFilterMap(const_true_map);
-    }
+    ConstMap<typename DGR::Node, Const<bool, true> > const_true_map;
+
+    FilterArcs() : const_true_map() {}
 
   public:
@@ -1659,9 +1652,7 @@
     /// Creates a subdigraph for the given digraph with the given arc
     /// filter map.
-    FilterArcs(Digraph& digraph, ArcFilterMap& arc_filter)
-      : Parent(), const_true_map(true) {
-      Parent::setDigraph(digraph);
-      Parent::setNodeFilterMap(const_true_map);
-      Parent::setArcFilterMap(arc_filter);
+    FilterArcs(DGR& digraph, ArcFilterMap& arc_filter)
+      : Parent(), const_true_map() {
+      Parent::initialize(digraph, const_true_map, arc_filter);
     }
 
@@ -1699,14 +1690,14 @@
   /// \ingroup graph_adaptors
   /// \relates FilterArcs
-  template<typename GR, typename AF>
-  FilterArcs<const GR, AF>
-  filterArcs(const GR& digraph, AF& arc_filter_map) {
-    return FilterArcs<const GR, AF>(digraph, arc_filter_map);
+  template<typename DGR, typename AF>
+  FilterArcs<const DGR, AF>
+  filterArcs(const DGR& digraph, AF& arc_filter) {
+    return FilterArcs<const DGR, AF>(digraph, arc_filter);
   }
 
-  template<typename GR, typename AF>
-  FilterArcs<const GR, const AF>
-  filterArcs(const GR& digraph, const AF& arc_filter_map) {
-    return FilterArcs<const GR, const AF>(digraph, arc_filter_map);
+  template<typename DGR, typename AF>
+  FilterArcs<const DGR, const AF>
+  filterArcs(const DGR& digraph, const AF& arc_filter) {
+    return FilterArcs<const DGR, const AF>(digraph, arc_filter);
   }
 
@@ -1744,5 +1735,6 @@
   class FilterEdges :
     public GraphAdaptorExtender<
-      SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> > {
+      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
+                   EF, false> > {
 #endif
   public:
@@ -1753,11 +1745,11 @@
 
     typedef GraphAdaptorExtender<
-      SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> >
-      Parent;
+      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
+                   EF, false> > Parent;
 
     typedef typename Parent::Edge Edge;
 
   protected:
-    ConstMap<typename Graph::Node, bool> const_true_map;
+    ConstMap<typename GR::Node, Const<bool, true> > const_true_map;
 
     FilterEdges() : const_true_map(true) {
@@ -1771,9 +1763,7 @@
     /// Creates a subgraph for the given graph with the given edge
     /// filter map.
-    FilterEdges(Graph& graph, EdgeFilterMap& edge_filter_map) :
-      Parent(), const_true_map(true) {
-      Parent::setGraph(graph);
-      Parent::setNodeFilterMap(const_true_map);
-      Parent::setEdgeFilterMap(edge_filter_map);
+    FilterEdges(GR& graph, EF& edge_filter) 
+      : Parent(), const_true_map() {
+      Parent::initialize(graph, const_true_map, edge_filter);
     }
 
@@ -1813,19 +1803,19 @@
   template<typename GR, typename EF>
   FilterEdges<const GR, EF>
-  filterEdges(const GR& graph, EF& edge_filter_map) {
-    return FilterEdges<const GR, EF>(graph, edge_filter_map);
+  filterEdges(const GR& graph, EF& edge_filter) {
+    return FilterEdges<const GR, EF>(graph, edge_filter);
   }
 
   template<typename GR, typename EF>
   FilterEdges<const GR, const EF>
-  filterEdges(const GR& graph, const EF& edge_filter_map) {
-    return FilterEdges<const GR, const EF>(graph, edge_filter_map);
+  filterEdges(const GR& graph, const EF& edge_filter) {
+    return FilterEdges<const GR, const EF>(graph, edge_filter);
   }
 
 
-  template <typename _Digraph>
+  template <typename DGR>
   class UndirectorBase {
   public:
-    typedef _Digraph Digraph;
+    typedef DGR Digraph;
     typedef UndirectorBase Adaptor;
 
@@ -2063,9 +2053,9 @@
   private:
 
-    template <typename _Value>
+    template <typename V>
     class ArcMapBase {
     private:
 
-      typedef typename Digraph::template ArcMap<_Value> MapImpl;
+      typedef typename DGR::template ArcMap<V> MapImpl;
 
     public:
@@ -2073,5 +2063,5 @@
       typedef typename MapTraits<MapImpl>::ReferenceMapTag ReferenceMapTag;
 
-      typedef _Value Value;
+      typedef V Value;
       typedef Arc Key;
       typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReturnValue;
@@ -2080,15 +2070,16 @@
       typedef typename MapTraits<MapImpl>::ReturnValue Reference;
 
-      ArcMapBase(const Adaptor& adaptor) :
+      ArcMapBase(const UndirectorBase<DGR>& adaptor) :
         _forward(*adaptor._digraph), _backward(*adaptor._digraph) {}
 
-      ArcMapBase(const Adaptor& adaptor, const Value& v)
-        : _forward(*adaptor._digraph, v), _backward(*adaptor._digraph, v) {}
-
-      void set(const Arc& a, const Value& v) {
+      ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
+        : _forward(*adaptor._digraph, value), 
+          _backward(*adaptor._digraph, value) {}
+
+      void set(const Arc& a, const V& value) {
         if (direction(a)) {
-          _forward.set(a, v);
+          _forward.set(a, value);
         } else {
-          _backward.set(a, v);
+          _backward.set(a, value);
         }
       }
@@ -2118,15 +2109,15 @@
   public:
 
-    template <typename _Value>
-    class NodeMap : public Digraph::template NodeMap<_Value> {
+    template <typename V>
+    class NodeMap : public DGR::template NodeMap<V> {
     public:
 
-      typedef _Value Value;
-      typedef typename Digraph::template NodeMap<Value> Parent;
-
-      explicit NodeMap(const Adaptor& adaptor)
+      typedef V Value;
+      typedef typename DGR::template NodeMap<Value> Parent;
+
+      explicit NodeMap(const UndirectorBase<DGR>& adaptor)
         : Parent(*adaptor._digraph) {}
 
-      NodeMap(const Adaptor& adaptor, const _Value& value)
+      NodeMap(const UndirectorBase<DGR>& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) { }
 
@@ -2144,16 +2135,16 @@
     };
 
-    template <typename _Value>
+    template <typename V>
     class ArcMap
-      : public SubMapExtender<Adaptor, ArcMapBase<_Value> >
+      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> >
     {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, ArcMapBase<Value> > Parent;
-
-      explicit ArcMap(const Adaptor& adaptor)
+      typedef V Value;
+      typedef SubMapExtender<Adaptor, ArcMapBase<V> > Parent;
+
+      explicit ArcMap(const UndirectorBase<DGR>& adaptor)
         : Parent(adaptor) {}
 
-      ArcMap(const Adaptor& adaptor, const Value& value)
+      ArcMap(const UndirectorBase<DGR>& adaptor, const V& value)
         : Parent(adaptor, value) {}
 
@@ -2170,15 +2161,15 @@
     };
 
-    template <typename _Value>
-    class EdgeMap : public Digraph::template ArcMap<_Value> {
+    template <typename V>
+    class EdgeMap : public Digraph::template ArcMap<V> {
     public:
 
-      typedef _Value Value;
-      typedef typename Digraph::template ArcMap<Value> Parent;
-
-      explicit EdgeMap(const Adaptor& adaptor)
+      typedef V Value;
+      typedef typename Digraph::template ArcMap<V> Parent;
+
+      explicit EdgeMap(const UndirectorBase<DGR>& adaptor)
         : Parent(*adaptor._digraph) {}
 
-      EdgeMap(const Adaptor& adaptor, const Value& value)
+      EdgeMap(const UndirectorBase<DGR>& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) {}
 
@@ -2196,8 +2187,8 @@
     };
 
-    typedef typename ItemSetTraits<Digraph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier;
     NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
 
-    typedef typename ItemSetTraits<Digraph, Edge>::ItemNotifier EdgeNotifier;
+    typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
     EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
 
@@ -2206,7 +2197,7 @@
     UndirectorBase() : _digraph(0) {}
 
-    Digraph* _digraph;
-
-    void setDigraph(Digraph& digraph) {
+    DGR* _digraph;
+
+    void initialize(DGR& digraph) {
       _digraph = &digraph;
     }
@@ -2227,5 +2218,5 @@
   /// parameter is set to be \c const.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It can also be specified to be \c const.
@@ -2237,15 +2228,15 @@
   /// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type
   /// of the adapted digraph.)
-  template<typename GR>
+  template<typename DGR>
 #ifdef DOXYGEN
   class Undirector {
 #else
   class Undirector :
-    public GraphAdaptorExtender<UndirectorBase<GR> > {
+    public GraphAdaptorExtender<UndirectorBase<DGR> > {
 #endif
   public:
     /// The type of the adapted digraph.
-    typedef GR Digraph;
-    typedef GraphAdaptorExtender<UndirectorBase<GR> > Parent;
+    typedef DGR Digraph;
+    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   protected:
     Undirector() { }
@@ -2255,6 +2246,6 @@
     ///
     /// Creates an undirected graph from the given digraph.
-    Undirector(Digraph& digraph) {
-      setDigraph(digraph);
+    Undirector(DGR& digraph) {
+      initialize(digraph);
     }
 
@@ -2356,19 +2347,19 @@
   /// \ingroup graph_adaptors
   /// \relates Undirector
-  template<typename GR>
-  Undirector<const GR> undirector(const GR& digraph) {
-    return Undirector<const GR>(digraph);
+  template<typename DGR>
+  Undirector<const DGR> undirector(const DGR& digraph) {
+    return Undirector<const DGR>(digraph);
   }
 
 
-  template <typename _Graph, typename _DirectionMap>
+  template <typename GR, typename DM>
   class OrienterBase {
   public:
 
-    typedef _Graph Graph;
-    typedef _DirectionMap DirectionMap;
-
-    typedef typename Graph::Node Node;
-    typedef typename Graph::Edge Arc;
+    typedef GR Graph;
+    typedef DM DirectionMap;
+
+    typedef typename GR::Node Node;
+    typedef typename GR::Edge Arc;
 
     void reverseArc(const Arc& arc) {
@@ -2449,20 +2440,20 @@
     int maxArcId() const { return _graph->maxEdgeId(); }
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
     NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
 
-    typedef typename ItemSetTraits<Graph, Arc>::ItemNotifier ArcNotifier;
+    typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier;
     ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
 
-    template <typename _Value>
-    class NodeMap : public _Graph::template NodeMap<_Value> {
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
 
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-
-      explicit NodeMap(const OrienterBase& adapter)
+      typedef typename GR::template NodeMap<V> Parent;
+
+      explicit NodeMap(const OrienterBase<GR, DM>& adapter)
         : Parent(*adapter._graph) {}
 
-      NodeMap(const OrienterBase& adapter, const _Value& value)
+      NodeMap(const OrienterBase<GR, DM>& adapter, const V& value)
         : Parent(*adapter._graph, value) {}
 
@@ -2480,14 +2471,14 @@
     };
 
-    template <typename _Value>
-    class ArcMap : public _Graph::template EdgeMap<_Value> {
+    template <typename V>
+    class ArcMap : public GR::template EdgeMap<V> {
     public:
 
-      typedef typename Graph::template EdgeMap<_Value> Parent;
-
-      explicit ArcMap(const OrienterBase& adapter)
+      typedef typename Graph::template EdgeMap<V> Parent;
+
+      explicit ArcMap(const OrienterBase<GR, DM>& adapter)
         : Parent(*adapter._graph) { }
 
-      ArcMap(const OrienterBase& adapter, const _Value& value)
+      ArcMap(const OrienterBase<GR, DM>& adapter, const V& value)
         : Parent(*adapter._graph, value) { }
 
@@ -2508,12 +2499,9 @@
   protected:
     Graph* _graph;
-    DirectionMap* _direction;
-
-    void setDirectionMap(DirectionMap& direction) {
+    DM* _direction;
+
+    void initialize(GR& graph, DM& direction) {
+      _graph = &graph;
       _direction = &direction;
-    }
-
-    void setGraph(Graph& graph) {
-      _graph = &graph;
     }
 
@@ -2573,7 +2561,6 @@
     ///
     /// Constructor of the adaptor.
-    Orienter(Graph& graph, DirectionMap& direction) {
-      setGraph(graph);
-      setDirectionMap(direction);
+    Orienter(GR& graph, DM& direction) {
+      Parent::initialize(graph, direction);
     }
 
@@ -2595,65 +2582,60 @@
   template<typename GR, typename DM>
   Orienter<const GR, DM>
-  orienter(const GR& graph, DM& direction_map) {
-    return Orienter<const GR, DM>(graph, direction_map);
+  orienter(const GR& graph, DM& direction) {
+    return Orienter<const GR, DM>(graph, direction);
   }
 
   template<typename GR, typename DM>
   Orienter<const GR, const DM>
-  orienter(const GR& graph, const DM& direction_map) {
-    return Orienter<const GR, const DM>(graph, direction_map);
+  orienter(const GR& graph, const DM& direction) {
+    return Orienter<const GR, const DM>(graph, direction);
   }
 
   namespace _adaptor_bits {
 
-    template<typename Digraph,
-             typename CapacityMap,
-             typename FlowMap,
-             typename Tolerance>
+    template <typename DGR, typename CM, typename FM, typename TL>
     class ResForwardFilter {
     public:
 
-      typedef typename Digraph::Arc Key;
+      typedef typename DGR::Arc Key;
       typedef bool Value;
 
     private:
 
-      const CapacityMap* _capacity;
-      const FlowMap* _flow;
-      Tolerance _tolerance;
+      const CM* _capacity;
+      const FM* _flow;
+      TL _tolerance;
+
     public:
 
-      ResForwardFilter(const CapacityMap& capacity, const FlowMap& flow,
-                       const Tolerance& tolerance = Tolerance())
+      ResForwardFilter(const CM& capacity, const FM& flow,
+                       const TL& tolerance = TL())
         : _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
 
-      bool operator[](const typename Digraph::Arc& a) const {
+      bool operator[](const typename DGR::Arc& a) const {
         return _tolerance.positive((*_capacity)[a] - (*_flow)[a]);
       }
     };
 
-    template<typename Digraph,
-             typename CapacityMap,
-             typename FlowMap,
-             typename Tolerance>
+    template<typename DGR,typename CM, typename FM, typename TL>
     class ResBackwardFilter {
     public:
 
-      typedef typename Digraph::Arc Key;
+      typedef typename DGR::Arc Key;
       typedef bool Value;
 
     private:
 
-      const CapacityMap* _capacity;
-      const FlowMap* _flow;
-      Tolerance _tolerance;
+      const CM* _capacity;
+      const FM* _flow;
+      TL _tolerance;
 
     public:
 
-      ResBackwardFilter(const CapacityMap& capacity, const FlowMap& flow,
-                        const Tolerance& tolerance = Tolerance())
+      ResBackwardFilter(const CM& capacity, const FM& flow,
+                        const TL& tolerance = TL())
         : _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
 
-      bool operator[](const typename Digraph::Arc& a) const {
+      bool operator[](const typename DGR::Arc& a) const {
         return _tolerance.positive((*_flow)[a]);
       }
@@ -2682,5 +2664,5 @@
   /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It is implicitly \c const.
@@ -2704,17 +2686,18 @@
   /// is convertible to the \c Arc type of the adapted digraph.
 #ifdef DOXYGEN
-  template<typename GR, typename CM, typename FM, typename TL>
+  template<typename DGR, typename CM, typename FM, typename TL>
   class ResidualDigraph
 #else
-  template<typename GR,
-           typename CM = typename GR::template ArcMap<int>,
+  template<typename DGR,
+           typename CM = typename DGR::template ArcMap<int>,
            typename FM = CM,
            typename TL = Tolerance<typename CM::Value> >
-  class ResidualDigraph :
-    public FilterArcs<
-      Undirector<const GR>,
-      typename Undirector<const GR>::template CombinedArcMap<
-        _adaptor_bits::ResForwardFilter<const GR, CM, FM, TL>,
-        _adaptor_bits::ResBackwardFilter<const GR, CM, FM, TL> > >
+  class ResidualDigraph 
+    : public SubDigraph<
+        Undirector<const DGR>,
+        ConstMap<typename DGR::Node, Const<bool, true> >,
+        typename Undirector<const DGR>::template CombinedArcMap<
+          _adaptor_bits::ResForwardFilter<const DGR, CM, FM, TL>,
+          _adaptor_bits::ResBackwardFilter<const DGR, CM, FM, TL> > >
 #endif
   {
@@ -2722,5 +2705,5 @@
 
     /// The type of the underlying digraph.
-    typedef GR Digraph;
+    typedef DGR Digraph;
     /// The type of the capacity map.
     typedef CM CapacityMap;
@@ -2737,14 +2720,16 @@
     typedef Undirector<const Digraph> Undirected;
 
-    typedef _adaptor_bits::ResForwardFilter<const Digraph, CapacityMap,
-                                            FlowMap, Tolerance> ForwardFilter;
-
-    typedef _adaptor_bits::ResBackwardFilter<const Digraph, CapacityMap,
-                                             FlowMap, Tolerance> BackwardFilter;
+    typedef ConstMap<typename DGR::Node, Const<bool, true> > NodeFilter;
+
+    typedef _adaptor_bits::ResForwardFilter<const DGR, CM,
+                                            FM, TL> ForwardFilter;
+
+    typedef _adaptor_bits::ResBackwardFilter<const DGR, CM,
+                                             FM, TL> BackwardFilter;
 
     typedef typename Undirected::
       template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
 
-    typedef FilterArcs<Undirected, ArcFilter> Parent;
+    typedef SubDigraph<Undirected, NodeFilter, ArcFilter> Parent;
 
     const CapacityMap* _capacity;
@@ -2752,4 +2737,5 @@
 
     Undirected _graph;
+    NodeFilter _node_filter;
     ForwardFilter _forward_filter;
     BackwardFilter _backward_filter;
@@ -2762,13 +2748,13 @@
     /// Constructor of the residual digraph adaptor. The parameters are the
     /// digraph, the capacity map, the flow map, and a tolerance object.
-    ResidualDigraph(const Digraph& digraph, const CapacityMap& capacity,
-                    FlowMap& flow, const Tolerance& tolerance = Tolerance())
-      : Parent(), _capacity(&capacity), _flow(&flow), _graph(digraph),
+    ResidualDigraph(const DGR& digraph, const CM& capacity,
+                    FM& flow, const TL& tolerance = Tolerance())
+      : Parent(), _capacity(&capacity), _flow(&flow), 
+        _graph(digraph), _node_filter(),
         _forward_filter(capacity, flow, tolerance),
         _backward_filter(capacity, flow, tolerance),
         _arc_filter(_forward_filter, _backward_filter)
     {
-      Parent::setDigraph(_graph);
-      Parent::setArcFilterMap(_arc_filter);
+      Parent::initialize(_graph, _node_filter, _arc_filter);
     }
 
@@ -2846,5 +2832,6 @@
 
       /// Constructor
-      ResidualCapacity(const Adaptor& adaptor) : _adaptor(&adaptor) {}
+      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 
+        : _adaptor(&adaptor) {}
 
       /// Returns the value associated with the given residual arc
@@ -2866,24 +2853,24 @@
   /// \brief Returns a (read-only) Residual adaptor
   ///
-  /// This function just returns a (read-only) \ref Residual adaptor.
+  /// This function just returns a (read-only) \ref ResidualDigraph adaptor.
   /// \ingroup graph_adaptors
-  /// \relates Residual
-  template<typename GR, typename CM, typename FM>
-  ResidualDigraph<GR, CM, FM>
-  residualDigraph(const GR& digraph, const CM& capacity_map, FM& flow_map) {
-    return ResidualDigraph<GR, CM, FM> (digraph, capacity_map, flow_map);
+  /// \relates ResidualDigraph
+    template<typename DGR, typename CM, typename FM>
+  ResidualDigraph<DGR, CM, FM>
+  residualDigraph(const DGR& digraph, const CM& capacity_map, FM& flow_map) {
+    return ResidualDigraph<DGR, CM, FM> (digraph, capacity_map, flow_map);
   }
 
 
-  template <typename _Digraph>
+  template <typename DGR>
   class SplitNodesBase {
   public:
 
-    typedef _Digraph Digraph;
-    typedef DigraphAdaptorBase<const _Digraph> Parent;
+    typedef DGR Digraph;
+    typedef DigraphAdaptorBase<const DGR> Parent;
     typedef SplitNodesBase Adaptor;
 
-    typedef typename Digraph::Node DigraphNode;
-    typedef typename Digraph::Arc DigraphArc;
+    typedef typename DGR::Node DigraphNode;
+    typedef typename DGR::Arc DigraphArc;
 
     class Node;
@@ -3149,11 +3136,11 @@
   private:
 
-    template <typename _Value>
+    template <typename V>
     class NodeMapBase
-      : public MapTraits<typename Parent::template NodeMap<_Value> > {
-      typedef typename Parent::template NodeMap<_Value> NodeImpl;
+      : public MapTraits<typename Parent::template NodeMap<V> > {
+      typedef typename Parent::template NodeMap<V> NodeImpl;
     public:
       typedef Node Key;
-      typedef _Value Value;
+      typedef V Value;
       typedef typename MapTraits<NodeImpl>::ReferenceMapTag ReferenceMapTag;
       typedef typename MapTraits<NodeImpl>::ReturnValue ReturnValue;
@@ -3162,17 +3149,17 @@
       typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReference;
 
-      NodeMapBase(const Adaptor& adaptor)
+      NodeMapBase(const SplitNodesBase<DGR>& adaptor)
         : _in_map(*adaptor._digraph), _out_map(*adaptor._digraph) {}
-      NodeMapBase(const Adaptor& adaptor, const Value& value)
+      NodeMapBase(const SplitNodesBase<DGR>& adaptor, const V& value)
         : _in_map(*adaptor._digraph, value),
           _out_map(*adaptor._digraph, value) {}
 
-      void set(const Node& key, const Value& val) {
-        if (Adaptor::inNode(key)) { _in_map.set(key, val); }
+      void set(const Node& key, const V& val) {
+        if (SplitNodesBase<DGR>::inNode(key)) { _in_map.set(key, val); }
         else {_out_map.set(key, val); }
       }
 
       ReturnValue operator[](const Node& key) {
-        if (Adaptor::inNode(key)) { return _in_map[key]; }
+        if (SplitNodesBase<DGR>::inNode(key)) { return _in_map[key]; }
         else { return _out_map[key]; }
       }
@@ -3187,12 +3174,12 @@
     };
 
-    template <typename _Value>
+    template <typename V>
     class ArcMapBase
-      : public MapTraits<typename Parent::template ArcMap<_Value> > {
-      typedef typename Parent::template ArcMap<_Value> ArcImpl;
-      typedef typename Parent::template NodeMap<_Value> NodeImpl;
+      : public MapTraits<typename Parent::template ArcMap<V> > {
+      typedef typename Parent::template ArcMap<V> ArcImpl;
+      typedef typename Parent::template NodeMap<V> NodeImpl;
     public:
       typedef Arc Key;
-      typedef _Value Value;
+      typedef V Value;
       typedef typename MapTraits<ArcImpl>::ReferenceMapTag ReferenceMapTag;
       typedef typename MapTraits<ArcImpl>::ReturnValue ReturnValue;
@@ -3201,12 +3188,12 @@
       typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReference;
 
-      ArcMapBase(const Adaptor& adaptor)
+      ArcMapBase(const SplitNodesBase<DGR>& adaptor)
         : _arc_map(*adaptor._digraph), _node_map(*adaptor._digraph) {}
-      ArcMapBase(const Adaptor& adaptor, const Value& value)
+      ArcMapBase(const SplitNodesBase<DGR>& adaptor, const V& value)
         : _arc_map(*adaptor._digraph, value),
           _node_map(*adaptor._digraph, value) {}
 
-      void set(const Arc& key, const Value& val) {
-        if (Adaptor::origArc(key)) {
+      void set(const Arc& key, const V& val) {
+        if (SplitNodesBase<DGR>::origArc(key)) {
           _arc_map.set(key._item.first(), val);
         } else {
@@ -3216,5 +3203,5 @@
 
       ReturnValue operator[](const Arc& key) {
-        if (Adaptor::origArc(key)) {
+        if (SplitNodesBase<DGR>::origArc(key)) {
           return _arc_map[key._item.first()];
         } else {
@@ -3224,5 +3211,5 @@
 
       ConstReturnValue operator[](const Arc& key) const {
-        if (Adaptor::origArc(key)) {
+        if (SplitNodesBase<DGR>::origArc(key)) {
           return _arc_map[key._item.first()];
         } else {
@@ -3238,16 +3225,16 @@
   public:
 
-    template <typename _Value>
+    template <typename V>
     class NodeMap
-      : public SubMapExtender<Adaptor, NodeMapBase<_Value> >
+      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> >
     {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, NodeMapBase<Value> > Parent;
-
-      NodeMap(const Adaptor& adaptor)
+      typedef V Value;
+      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<Value> > Parent;
+
+      NodeMap(const SplitNodesBase<DGR>& adaptor)
         : Parent(adaptor) {}
 
-      NodeMap(const Adaptor& adaptor, const Value& value)
+      NodeMap(const SplitNodesBase<DGR>& adaptor, const V& value)
         : Parent(adaptor, value) {}
 
@@ -3264,16 +3251,16 @@
     };
 
-    template <typename _Value>
+    template <typename V>
     class ArcMap
-      : public SubMapExtender<Adaptor, ArcMapBase<_Value> >
+      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> >
     {
     public:
-      typedef _Value Value;
-      typedef SubMapExtender<Adaptor, ArcMapBase<Value> > Parent;
-
-      ArcMap(const Adaptor& adaptor)
+      typedef V Value;
+      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<Value> > Parent;
+
+      ArcMap(const SplitNodesBase<DGR>& adaptor)
         : Parent(adaptor) {}
 
-      ArcMap(const Adaptor& adaptor, const Value& value)
+      ArcMap(const SplitNodesBase<DGR>& adaptor, const V& value)
         : Parent(adaptor, value) {}
 
@@ -3294,7 +3281,7 @@
     SplitNodesBase() : _digraph(0) {}
 
-    Digraph* _digraph;
-
-    void setDigraph(Digraph& digraph) {
+    DGR* _digraph;
+
+    void initialize(Digraph& digraph) {
       _digraph = &digraph;
     }
@@ -3323,5 +3310,5 @@
   /// in the adaptor.
   ///
-  /// \tparam GR The type of the adapted digraph.
+  /// \tparam DGR The type of the adapted digraph.
   /// It must conform to the \ref concepts::Digraph "Digraph" concept.
   /// It is implicitly \c const.
@@ -3329,17 +3316,17 @@
   /// \note The \c Node type of this adaptor is converible to the \c Node
   /// type of the adapted digraph.
-  template <typename GR>
+  template <typename DGR>
 #ifdef DOXYGEN
   class SplitNodes {
 #else
   class SplitNodes
-    : public DigraphAdaptorExtender<SplitNodesBase<const GR> > {
+    : public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
 #endif
   public:
-    typedef GR Digraph;
-    typedef DigraphAdaptorExtender<SplitNodesBase<const GR> > Parent;
-
-    typedef typename Digraph::Node DigraphNode;
-    typedef typename Digraph::Arc DigraphArc;
+    typedef DGR Digraph;
+    typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
+
+    typedef typename DGR::Node DigraphNode;
+    typedef typename DGR::Arc DigraphArc;
 
     typedef typename Parent::Node Node;
@@ -3349,6 +3336,6 @@
     ///
     /// Constructor of the adaptor.
-    SplitNodes(const Digraph& g) {
-      Parent::setDigraph(g);
+    SplitNodes(const DGR& g) {
+      Parent::initialize(g);
     }
 
@@ -3442,5 +3429,5 @@
       /// Returns the value associated with the given key.
       Value operator[](const Key& key) const {
-        if (Parent::inNode(key)) {
+        if (SplitNodesBase<const DGR>::inNode(key)) {
           return _in_map[key];
         } else {
@@ -3451,5 +3438,5 @@
       /// Returns a reference to the value associated with the given key.
       Value& operator[](const Key& key) {
-        if (Parent::inNode(key)) {
+        if (SplitNodesBase<const DGR>::inNode(key)) {
           return _in_map[key];
         } else {
@@ -3460,5 +3447,5 @@
       /// Sets the value associated with the given key.
       void set(const Key& key, const Value& value) {
-        if (Parent::inNode(key)) {
+        if (SplitNodesBase<const DGR>::inNode(key)) {
           _in_map.set(key, value);
         } else {
@@ -3531,5 +3518,5 @@
       /// Returns the value associated with the given key.
       Value operator[](const Key& arc) const {
-        if (Parent::origArc(arc)) {
+        if (SplitNodesBase<const DGR>::origArc(arc)) {
           return _arc_map[arc];
         } else {
@@ -3540,5 +3527,5 @@
       /// Returns a reference to the value associated with the given key.
       Value& operator[](const Key& arc) {
-        if (Parent::origArc(arc)) {
+        if (SplitNodesBase<const DGR>::origArc(arc)) {
           return _arc_map[arc];
         } else {
@@ -3549,5 +3536,5 @@
       /// Sets the value associated with the given key.
       void set(const Arc& arc, const Value& val) {
-        if (Parent::origArc(arc)) {
+        if (SplitNodesBase<const DGR>::origArc(arc)) {
           _arc_map.set(arc, val);
         } else {
@@ -3595,10 +3582,12 @@
   /// \ingroup graph_adaptors
   /// \relates SplitNodes
-  template<typename GR>
-  SplitNodes<GR>
-  splitNodes(const GR& digraph) {
-    return SplitNodes<GR>(digraph);
+  template<typename DGR>
+  SplitNodes<DGR>
+  splitNodes(const DGR& digraph) {
+    return SplitNodes<DGR>(digraph);
   }
 
+#undef LEMON_SCOPE_FIX
+
 } //namespace lemon
 
Index: lemon/edge_set.h
===================================================================
--- lemon/edge_set.h	(revision 468)
+++ lemon/edge_set.h	(revision 512)
@@ -30,11 +30,11 @@
 namespace lemon {
 
-  template <typename _Graph>
+  template <typename GR>
   class ListArcSetBase {
   public:
 
-    typedef _Graph Graph;
-    typedef typename Graph::Node Node;
-    typedef typename Graph::NodeIt NodeIt;
+    typedef GR Graph;
+    typedef typename GR::Node Node;
+    typedef typename GR::NodeIt NodeIt;
 
   protected:
@@ -45,8 +45,8 @@
     };
 
-    typedef typename ItemSetTraits<Graph, Node>::
+    typedef typename ItemSetTraits<GR, Node>::
     template Map<NodeT>::Type NodesImplBase;
 
-    NodesImplBase* nodes;
+    NodesImplBase* _nodes;
 
     struct ArcT {
@@ -62,9 +62,9 @@
     int first_free_arc;
 
-    const Graph* graph;
-
-    void initalize(const Graph& _graph, NodesImplBase& _nodes) {
-      graph = &_graph;
-      nodes = &_nodes;
+    const GR* _graph;
+
+    void initalize(const GR& graph, NodesImplBase& nodes) {
+      _graph = &graph;
+      _nodes = &nodes;
     }
 
@@ -72,5 +72,5 @@
 
     class Arc {
-      friend class ListArcSetBase<Graph>;
+      friend class ListArcSetBase<GR>;
     protected:
       Arc(int _id) : id(_id) {}
@@ -95,14 +95,14 @@
         first_free_arc = arcs[first_free_arc].next_in;
       }
-      arcs[n].next_in = (*nodes)[v].first_in;
-      if ((*nodes)[v].first_in != -1) {
-        arcs[(*nodes)[v].first_in].prev_in = n;
-      }
-      (*nodes)[v].first_in = n;
-      arcs[n].next_out = (*nodes)[u].first_out;
-      if ((*nodes)[u].first_out != -1) {
-        arcs[(*nodes)[u].first_out].prev_out = n;
-      }
-      (*nodes)[u].first_out = n;
+      arcs[n].next_in = (*_nodes)[v].first_in;
+      if ((*_nodes)[v].first_in != -1) {
+        arcs[(*_nodes)[v].first_in].prev_in = n;
+      }
+      (*_nodes)[v].first_in = n;
+      arcs[n].next_out = (*_nodes)[u].first_out;
+      if ((*_nodes)[u].first_out != -1) {
+        arcs[(*_nodes)[u].first_out].prev_out = n;
+      }
+      (*_nodes)[u].first_out = n;
       arcs[n].source = u;
       arcs[n].target = v;
@@ -115,5 +115,5 @@
         arcs[arcs[n].prev_in].next_in = arcs[n].next_in;
       } else {
-        (*nodes)[arcs[n].target].first_in = arcs[n].next_in;
+        (*_nodes)[arcs[n].target].first_in = arcs[n].next_in;
       }
       if (arcs[n].next_in != -1) {
@@ -124,5 +124,5 @@
         arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
       } else {
-        (*nodes)[arcs[n].source].first_out = arcs[n].next_out;
+        (*_nodes)[arcs[n].source].first_out = arcs[n].next_out;
       }
       if (arcs[n].next_out != -1) {
@@ -135,6 +135,6 @@
       Node node;
       for (first(node); node != INVALID; next(node)) {
-        (*nodes)[node].first_in = -1;
-        (*nodes)[node].first_out = -1;
+        (*_nodes)[node].first_in = -1;
+        (*_nodes)[node].first_out = -1;
       }
       arcs.clear();
@@ -144,9 +144,9 @@
 
     void first(Node& node) const {
-      graph->first(node);
+      _graph->first(node);
     }
 
     void next(Node& node) const {
-      graph->next(node);
+      _graph->next(node);
     }
 
@@ -154,8 +154,8 @@
       Node node;
       first(node);
-      while (node != INVALID && (*nodes)[node].first_in == -1) {
+      while (node != INVALID && (*_nodes)[node].first_in == -1) {
         next(node);
       }
-      arc.id = (node == INVALID) ? -1 : (*nodes)[node].first_in;
+      arc.id = (node == INVALID) ? -1 : (*_nodes)[node].first_in;
     }
 
@@ -166,13 +166,13 @@
         Node node = arcs[arc.id].target;
         next(node);
-        while (node != INVALID && (*nodes)[node].first_in == -1) {
+        while (node != INVALID && (*_nodes)[node].first_in == -1) {
           next(node);
         }
-        arc.id = (node == INVALID) ? -1 : (*nodes)[node].first_in;
+        arc.id = (node == INVALID) ? -1 : (*_nodes)[node].first_in;
       }
     }
 
     void firstOut(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_out;
+      arc.id = (*_nodes)[node].first_out;
     }
 
@@ -182,5 +182,5 @@
 
     void firstIn(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_in;
+      arc.id = (*_nodes)[node].first_in;
     }
 
@@ -189,11 +189,11 @@
     }
 
-    int id(const Node& node) const { return graph->id(node); }
+    int id(const Node& node) const { return _graph->id(node); }
     int id(const Arc& arc) const { return arc.id; }
 
-    Node nodeFromId(int ix) const { return graph->nodeFromId(ix); }
+    Node nodeFromId(int ix) const { return _graph->nodeFromId(ix); }
     Arc arcFromId(int ix) const { return Arc(ix); }
 
-    int maxNodeId() const { return graph->maxNodeId(); };
+    int maxNodeId() const { return _graph->maxNodeId(); };
     int maxArcId() const { return arcs.size() - 1; }
 
@@ -201,21 +201,21 @@
     Node target(const Arc& arc) const { return arcs[arc.id].target;}
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
 
     NodeNotifier& notifier(Node) const {
-      return graph->notifier(Node());
-    }
-
-    template <typename _Value>
-    class NodeMap : public Graph::template NodeMap<_Value> {
+      return _graph->notifier(Node());
+    }
+
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
 
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-
-      explicit NodeMap(const ListArcSetBase<Graph>& arcset)
-        : Parent(*arcset.graph) {}
-
-      NodeMap(const ListArcSetBase<Graph>& arcset, const _Value& value)
-        : Parent(*arcset.graph, value) {}
+      typedef typename GR::template NodeMap<V> Parent;
+
+      explicit NodeMap(const ListArcSetBase<GR>& arcset)
+        : Parent(*arcset._graph) {}
+
+      NodeMap(const ListArcSetBase<GR>& arcset, const V& value)
+        : Parent(*arcset._graph, value) {}
 
       NodeMap& operator=(const NodeMap& cmap) {
@@ -251,5 +251,5 @@
   /// all arcs incident to the given node is erased from the arc set.
   ///
-  /// \param _Graph The type of the graph which shares its node set with
+  /// \param GR The type of the graph which shares its node set with
   /// this class. Its interface must conform to the
   /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
@@ -258,15 +258,15 @@
   /// This class is fully conform to the \ref concepts::Digraph
   /// "Digraph" concept.
-  template <typename _Graph>
-  class ListArcSet : public ArcSetExtender<ListArcSetBase<_Graph> > {
-
-  public:
-
-    typedef ArcSetExtender<ListArcSetBase<_Graph> > Parent;
+  template <typename GR>
+  class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
+
+  public:
+
+    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
 
-    typedef _Graph Graph;
+    typedef GR Graph;
 
 
@@ -296,5 +296,5 @@
       typedef NodesImplBase Parent;
 
-      NodesImpl(const Graph& graph, ListArcSet& arcset)
+      NodesImpl(const GR& graph, ListArcSet& arcset)
         : Parent(graph), _arcset(arcset) {}
 
@@ -322,5 +322,5 @@
     };
 
-    NodesImpl nodes;
+    NodesImpl _nodes;
 
   public:
@@ -329,6 +329,6 @@
     ///
     /// Constructor of the ArcSet.
-    ListArcSet(const Graph& graph) : nodes(graph, *this) {
-      Parent::initalize(graph, nodes);
+    ListArcSet(const GR& graph) : _nodes(graph, *this) {
+      Parent::initalize(graph, _nodes);
     }
 
@@ -351,11 +351,11 @@
   };
 
-  template <typename _Graph>
+  template <typename GR>
   class ListEdgeSetBase {
   public:
 
-    typedef _Graph Graph;
-    typedef typename Graph::Node Node;
-    typedef typename Graph::NodeIt NodeIt;
+    typedef GR Graph;
+    typedef typename GR::Node Node;
+    typedef typename GR::NodeIt NodeIt;
 
   protected:
@@ -366,8 +366,8 @@
     };
 
-    typedef typename ItemSetTraits<Graph, Node>::
+    typedef typename ItemSetTraits<GR, Node>::
     template Map<NodeT>::Type NodesImplBase;
 
-    NodesImplBase* nodes;
+    NodesImplBase* _nodes;
 
     struct ArcT {
@@ -382,9 +382,9 @@
     int first_free_arc;
 
-    const Graph* graph;
-
-    void initalize(const Graph& _graph, NodesImplBase& _nodes) {
-      graph = &_graph;
-      nodes = &_nodes;
+    const GR* _graph;
+
+    void initalize(const GR& graph, NodesImplBase& nodes) {
+      _graph = &graph;
+      _nodes = &nodes;
     }
 
@@ -438,16 +438,16 @@
       arcs[n | 1].target = v;
 
-      arcs[n].next_out = (*nodes)[v].first_out;
-      if ((*nodes)[v].first_out != -1) {
-        arcs[(*nodes)[v].first_out].prev_out = n;
-      }
-      (*nodes)[v].first_out = n;
+      arcs[n].next_out = (*_nodes)[v].first_out;
+      if ((*_nodes)[v].first_out != -1) {
+        arcs[(*_nodes)[v].first_out].prev_out = n;
+      }
+      (*_nodes)[v].first_out = n;
       arcs[n].prev_out = -1;
 
-      if ((*nodes)[u].first_out != -1) {
-        arcs[(*nodes)[u].first_out].prev_out = (n | 1);
-      }
-      arcs[n | 1].next_out = (*nodes)[u].first_out;
-      (*nodes)[u].first_out = (n | 1);
+      if ((*_nodes)[u].first_out != -1) {
+        arcs[(*_nodes)[u].first_out].prev_out = (n | 1);
+      }
+      arcs[n | 1].next_out = (*_nodes)[u].first_out;
+      (*_nodes)[u].first_out = (n | 1);
       arcs[n | 1].prev_out = -1;
 
@@ -465,5 +465,5 @@
         arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
       } else {
-        (*nodes)[arcs[n | 1].target].first_out = arcs[n].next_out;
+        (*_nodes)[arcs[n | 1].target].first_out = arcs[n].next_out;
       }
 
@@ -475,5 +475,5 @@
         arcs[arcs[n | 1].prev_out].next_out = arcs[n | 1].next_out;
       } else {
-        (*nodes)[arcs[n].target].first_out = arcs[n | 1].next_out;
+        (*_nodes)[arcs[n].target].first_out = arcs[n | 1].next_out;
       }
 
@@ -486,5 +486,5 @@
       Node node;
       for (first(node); node != INVALID; next(node)) {
-        (*nodes)[node].first_out = -1;
+        (*_nodes)[node].first_out = -1;
       }
       arcs.clear();
@@ -494,9 +494,9 @@
 
     void first(Node& node) const {
-      graph->first(node);
+      _graph->first(node);
     }
 
     void next(Node& node) const {
-      graph->next(node);
+      _graph->next(node);
     }
 
@@ -504,8 +504,8 @@
       Node node;
       first(node);
-      while (node != INVALID && (*nodes)[node].first_out == -1) {
+      while (node != INVALID && (*_nodes)[node].first_out == -1) {
         next(node);
       }
-      arc.id = (node == INVALID) ? -1 : (*nodes)[node].first_out;
+      arc.id = (node == INVALID) ? -1 : (*_nodes)[node].first_out;
     }
 
@@ -516,8 +516,8 @@
         Node node = arcs[arc.id ^ 1].target;
         next(node);
-        while(node != INVALID && (*nodes)[node].first_out == -1) {
+        while(node != INVALID && (*_nodes)[node].first_out == -1) {
           next(node);
         }
-        arc.id = (node == INVALID) ? -1 : (*nodes)[node].first_out;
+        arc.id = (node == INVALID) ? -1 : (*_nodes)[node].first_out;
       }
     }
@@ -527,5 +527,5 @@
       first(node);
       while (node != INVALID) {
-        edge.id = (*nodes)[node].first_out;
+        edge.id = (*_nodes)[node].first_out;
         while ((edge.id & 1) != 1) {
           edge.id = arcs[edge.id].next_out;
@@ -552,5 +552,5 @@
       next(node);
       while (node != INVALID) {
-        edge.id = (*nodes)[node].first_out;
+        edge.id = (*_nodes)[node].first_out;
         while ((edge.id & 1) != 1) {
           edge.id = arcs[edge.id].next_out;
@@ -566,5 +566,5 @@
 
     void firstOut(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_out;
+      arc.id = (*_nodes)[node].first_out;
     }
 
@@ -574,5 +574,5 @@
 
     void firstIn(Arc& arc, const Node& node) const {
-      arc.id = (((*nodes)[node].first_out) ^ 1);
+      arc.id = (((*_nodes)[node].first_out) ^ 1);
       if (arc.id == -2) arc.id = -1;
     }
@@ -584,5 +584,5 @@
 
     void firstInc(Edge &arc, bool& dir, const Node& node) const {
-      int de = (*nodes)[node].first_out;
+      int de = (*_nodes)[node].first_out;
       if (de != -1 ) {
         arc.id = de / 2;
@@ -612,13 +612,13 @@
     }
 
-    int id(const Node& node) const { return graph->id(node); }
+    int id(const Node& node) const { return _graph->id(node); }
     static int id(Arc e) { return e.id; }
     static int id(Edge e) { return e.id; }
 
-    Node nodeFromId(int id) const { return graph->nodeFromId(id); }
+    Node nodeFromId(int id) const { return _graph->nodeFromId(id); }
     static Arc arcFromId(int id) { return Arc(id);}
     static Edge edgeFromId(int id) { return Edge(id);}
 
-    int maxNodeId() const { return graph->maxNodeId(); };
+    int maxNodeId() const { return _graph->maxNodeId(); };
     int maxEdgeId() const { return arcs.size() / 2 - 1; }
     int maxArcId() const { return arcs.size()-1; }
@@ -630,21 +630,21 @@
     Node v(Edge e) const { return arcs[2 * e.id + 1].target; }
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
 
     NodeNotifier& notifier(Node) const {
-      return graph->notifier(Node());
-    }
-
-    template <typename _Value>
-    class NodeMap : public Graph::template NodeMap<_Value> {
+      return _graph->notifier(Node());
+    }
+
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
 
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-
-      explicit NodeMap(const ListEdgeSetBase<Graph>& arcset)
-        : Parent(*arcset.graph) {}
-
-      NodeMap(const ListEdgeSetBase<Graph>& arcset, const _Value& value)
-        : Parent(*arcset.graph, value) {}
+      typedef typename GR::template NodeMap<V> Parent;
+
+      explicit NodeMap(const ListEdgeSetBase<GR>& arcset)
+        : Parent(*arcset._graph) {}
+
+      NodeMap(const ListEdgeSetBase<GR>& arcset, const V& value)
+        : Parent(*arcset._graph, value) {}
 
       NodeMap& operator=(const NodeMap& cmap) {
@@ -680,5 +680,5 @@
   /// incident to the given node is erased from the arc set.
   ///
-  /// \param _Graph The type of the graph which shares its node set
+  /// \param GR The type of the graph which shares its node set
   /// with this class. Its interface must conform to the
   /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
@@ -687,10 +687,10 @@
   /// This class is fully conform to the \ref concepts::Graph "Graph"
   /// concept.
-  template <typename _Graph>
-  class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<_Graph> > {
-
-  public:
-
-    typedef EdgeSetExtender<ListEdgeSetBase<_Graph> > Parent;
+  template <typename GR>
+  class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
+
+  public:
+
+    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
 
     typedef typename Parent::Node Node;
@@ -698,5 +698,5 @@
     typedef typename Parent::Edge Edge;
 
-    typedef _Graph Graph;
+    typedef GR Graph;
 
 
@@ -721,5 +721,5 @@
       typedef NodesImplBase Parent;
 
-      NodesImpl(const Graph& graph, ListEdgeSet& arcset)
+      NodesImpl(const GR& graph, ListEdgeSet& arcset)
         : Parent(graph), _arcset(arcset) {}
 
@@ -747,5 +747,5 @@
     };
 
-    NodesImpl nodes;
+    NodesImpl _nodes;
 
   public:
@@ -754,6 +754,6 @@
     ///
     /// Constructor of the EdgeSet.
-    ListEdgeSet(const Graph& graph) : nodes(graph, *this) {
-      Parent::initalize(graph, nodes);
+    ListEdgeSet(const GR& graph) : _nodes(graph, *this) {
+      Parent::initalize(graph, _nodes);
     }
 
@@ -776,9 +776,9 @@
   };
 
-  template <typename _Graph>
+  template <typename GR>
   class SmartArcSetBase {
   public:
 
-    typedef _Graph Graph;
+    typedef GR Graph;
     typedef typename Graph::Node Node;
     typedef typename Graph::NodeIt NodeIt;
@@ -791,8 +791,8 @@
     };
 
-    typedef typename ItemSetTraits<Graph, Node>::
+    typedef typename ItemSetTraits<GR, Node>::
     template Map<NodeT>::Type NodesImplBase;
 
-    NodesImplBase* nodes;
+    NodesImplBase* _nodes;
 
     struct ArcT {
@@ -804,9 +804,9 @@
     std::vector<ArcT> arcs;
 
-    const Graph* graph;
-
-    void initalize(const Graph& _graph, NodesImplBase& _nodes) {
-      graph = &_graph;
-      nodes = &_nodes;
+    const GR* _graph;
+
+    void initalize(const GR& graph, NodesImplBase& nodes) {
+      _graph = &graph;
+      _nodes = &nodes;
     }
 
@@ -814,5 +814,5 @@
 
     class Arc {
-      friend class SmartArcSetBase<Graph>;
+      friend class SmartArcSetBase<GR>;
     protected:
       Arc(int _id) : id(_id) {}
@@ -831,8 +831,8 @@
       int n = arcs.size();
       arcs.push_back(ArcT());
-      arcs[n].next_in = (*nodes)[v].first_in;
-      (*nodes)[v].first_in = n;
-      arcs[n].next_out = (*nodes)[u].first_out;
-      (*nodes)[u].first_out = n;
+      arcs[n].next_in = (*_nodes)[v].first_in;
+      (*_nodes)[v].first_in = n;
+      arcs[n].next_out = (*_nodes)[u].first_out;
+      (*_nodes)[u].first_out = n;
       arcs[n].source = u;
       arcs[n].target = v;
@@ -843,6 +843,6 @@
       Node node;
       for (first(node); node != INVALID; next(node)) {
-        (*nodes)[node].first_in = -1;
-        (*nodes)[node].first_out = -1;
+        (*_nodes)[node].first_in = -1;
+        (*_nodes)[node].first_out = -1;
       }
       arcs.clear();
@@ -850,9 +850,9 @@
 
     void first(Node& node) const {
-      graph->first(node);
+      _graph->first(node);
     }
 
     void next(Node& node) const {
-      graph->next(node);
+      _graph->next(node);
     }
 
@@ -866,5 +866,5 @@
 
     void firstOut(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_out;
+      arc.id = (*_nodes)[node].first_out;
     }
 
@@ -874,5 +874,5 @@
 
     void firstIn(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_in;
+      arc.id = (*_nodes)[node].first_in;
     }
 
@@ -881,11 +881,11 @@
     }
 
-    int id(const Node& node) const { return graph->id(node); }
+    int id(const Node& node) const { return _graph->id(node); }
     int id(const Arc& arc) const { return arc.id; }
 
-    Node nodeFromId(int ix) const { return graph->nodeFromId(ix); }
+    Node nodeFromId(int ix) const { return _graph->nodeFromId(ix); }
     Arc arcFromId(int ix) const { return Arc(ix); }
 
-    int maxNodeId() const { return graph->maxNodeId(); };
+    int maxNodeId() const { return _graph->maxNodeId(); };
     int maxArcId() const { return arcs.size() - 1; }
 
@@ -893,21 +893,21 @@
     Node target(const Arc& arc) const { return arcs[arc.id].target;}
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
 
     NodeNotifier& notifier(Node) const {
-      return graph->notifier(Node());
-    }
-
-    template <typename _Value>
-    class NodeMap : public Graph::template NodeMap<_Value> {
+      return _graph->notifier(Node());
+    }
+
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
 
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-
-      explicit NodeMap(const SmartArcSetBase<Graph>& arcset)
-        : Parent(*arcset.graph) { }
-
-      NodeMap(const SmartArcSetBase<Graph>& arcset, const _Value& value)
-        : Parent(*arcset.graph, value) { }
+      typedef typename GR::template NodeMap<V> Parent;
+
+      explicit NodeMap(const SmartArcSetBase<GR>& arcset)
+        : Parent(*arcset._graph) { }
+
+      NodeMap(const SmartArcSetBase<GR>& arcset, const V& value)
+        : Parent(*arcset._graph, value) { }
 
       NodeMap& operator=(const NodeMap& cmap) {
@@ -938,5 +938,5 @@
   /// iterators) works equivalently as in the original graph.
   ///
-  /// \param _Graph The type of the graph which shares its node set with
+  /// \param GR The type of the graph which shares its node set with
   /// this class. Its interface must conform to the
   /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
@@ -955,15 +955,15 @@
   /// This class is fully conform to the \ref concepts::Digraph
   /// "Digraph" concept.
-  template <typename _Graph>
-  class SmartArcSet : public ArcSetExtender<SmartArcSetBase<_Graph> > {
-
-  public:
-
-    typedef ArcSetExtender<SmartArcSetBase<_Graph> > Parent;
+  template <typename GR>
+  class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
+
+  public:
+
+    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
 
-    typedef _Graph Graph;
+    typedef GR Graph;
 
   protected:
@@ -987,5 +987,5 @@
       typedef NodesImplBase Parent;
 
-      NodesImpl(const Graph& graph, SmartArcSet& arcset)
+      NodesImpl(const GR& graph, SmartArcSet& arcset)
         : Parent(graph), _arcset(arcset) {}
 
@@ -1027,5 +1027,5 @@
     };
 
-    NodesImpl nodes;
+    NodesImpl _nodes;
 
   public:
@@ -1034,6 +1034,6 @@
     ///
     /// Constructor of the ArcSet.
-    SmartArcSet(const Graph& graph) : nodes(graph, *this) {
-      Parent::initalize(graph, nodes);
+    SmartArcSet(const GR& graph) : _nodes(graph, *this) {
+      Parent::initalize(graph, _nodes);
     }
 
@@ -1053,5 +1053,5 @@
     /// erased and it is not isolated in the ArcSet.
     bool valid() const {
-      return nodes.attached();
+      return _nodes.attached();
     }
 
@@ -1059,11 +1059,11 @@
 
 
-  template <typename _Graph>
+  template <typename GR>
   class SmartEdgeSetBase {
   public:
 
-    typedef _Graph Graph;
-    typedef typename Graph::Node Node;
-    typedef typename Graph::NodeIt NodeIt;
+    typedef GR Graph;
+    typedef typename GR::Node Node;
+    typedef typename GR::NodeIt NodeIt;
 
   protected:
@@ -1074,8 +1074,8 @@
     };
 
-    typedef typename ItemSetTraits<Graph, Node>::
+    typedef typename ItemSetTraits<GR, Node>::
     template Map<NodeT>::Type NodesImplBase;
 
-    NodesImplBase* nodes;
+    NodesImplBase* _nodes;
 
     struct ArcT {
@@ -1087,9 +1087,9 @@
     std::vector<ArcT> arcs;
 
-    const Graph* graph;
-
-    void initalize(const Graph& _graph, NodesImplBase& _nodes) {
-      graph = &_graph;
-      nodes = &_nodes;
+    const GR* _graph;
+
+    void initalize(const GR& graph, NodesImplBase& nodes) {
+      _graph = &graph;
+      _nodes = &nodes;
     }
 
@@ -1136,9 +1136,9 @@
       arcs[n | 1].target = v;
 
-      arcs[n].next_out = (*nodes)[v].first_out;
-      (*nodes)[v].first_out = n;
-
-      arcs[n | 1].next_out = (*nodes)[u].first_out;
-      (*nodes)[u].first_out = (n | 1);
+      arcs[n].next_out = (*_nodes)[v].first_out;
+      (*_nodes)[v].first_out = n;
+
+      arcs[n | 1].next_out = (*_nodes)[u].first_out;
+      (*_nodes)[u].first_out = (n | 1);
 
       return Edge(n / 2);
@@ -1148,5 +1148,5 @@
       Node node;
       for (first(node); node != INVALID; next(node)) {
-        (*nodes)[node].first_out = -1;
+        (*_nodes)[node].first_out = -1;
       }
       arcs.clear();
@@ -1154,9 +1154,9 @@
 
     void first(Node& node) const {
-      graph->first(node);
+      _graph->first(node);
     }
 
     void next(Node& node) const {
-      graph->next(node);
+      _graph->next(node);
     }
 
@@ -1178,5 +1178,5 @@
 
     void firstOut(Arc& arc, const Node& node) const {
-      arc.id = (*nodes)[node].first_out;
+      arc.id = (*_nodes)[node].first_out;
     }
 
@@ -1186,5 +1186,5 @@
 
     void firstIn(Arc& arc, const Node& node) const {
-      arc.id = (((*nodes)[node].first_out) ^ 1);
+      arc.id = (((*_nodes)[node].first_out) ^ 1);
       if (arc.id == -2) arc.id = -1;
     }
@@ -1196,5 +1196,5 @@
 
     void firstInc(Edge &arc, bool& dir, const Node& node) const {
-      int de = (*nodes)[node].first_out;
+      int de = (*_nodes)[node].first_out;
       if (de != -1 ) {
         arc.id = de / 2;
@@ -1224,13 +1224,13 @@
     }
 
-    int id(Node node) const { return graph->id(node); }
+    int id(Node node) const { return _graph->id(node); }
     static int id(Arc arc) { return arc.id; }
     static int id(Edge arc) { return arc.id; }
 
-    Node nodeFromId(int id) const { return graph->nodeFromId(id); }
+    Node nodeFromId(int id) const { return _graph->nodeFromId(id); }
     static Arc arcFromId(int id) { return Arc(id); }
     static Edge edgeFromId(int id) { return Edge(id);}
 
-    int maxNodeId() const { return graph->maxNodeId(); };
+    int maxNodeId() const { return _graph->maxNodeId(); };
     int maxArcId() const { return arcs.size() - 1; }
     int maxEdgeId() const { return arcs.size() / 2 - 1; }
@@ -1242,21 +1242,21 @@
     Node v(Edge e) const { return arcs[2 * e.id + 1].target; }
 
-    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
 
     NodeNotifier& notifier(Node) const {
-      return graph->notifier(Node());
-    }
-
-    template <typename _Value>
-    class NodeMap : public Graph::template NodeMap<_Value> {
+      return _graph->notifier(Node());
+    }
+
+    template <typename V>
+    class NodeMap : public GR::template NodeMap<V> {
     public:
 
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-
-      explicit NodeMap(const SmartEdgeSetBase<Graph>& arcset)
-        : Parent(*arcset.graph) { }
-
-      NodeMap(const SmartEdgeSetBase<Graph>& arcset, const _Value& value)
-        : Parent(*arcset.graph, value) { }
+      typedef typename GR::template NodeMap<V> Parent;
+
+      explicit NodeMap(const SmartEdgeSetBase<GR>& arcset)
+        : Parent(*arcset._graph) { }
+
+      NodeMap(const SmartEdgeSetBase<GR>& arcset, const V& value)
+        : Parent(*arcset._graph, value) { }
 
       NodeMap& operator=(const NodeMap& cmap) {
@@ -1286,5 +1286,5 @@
   /// works equivalently as in the original graph.
   ///
-  /// \param _Graph The type of the graph which shares its node set
+  /// \param GR The type of the graph which shares its node set
   /// with this class. Its interface must conform to the
   /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
@@ -1303,10 +1303,10 @@
   /// This class is fully conform to the \ref concepts::Graph
   /// "Graph" concept.
-  template <typename _Graph>
-  class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<_Graph> > {
-
-  public:
-
-    typedef EdgeSetExtender<SmartEdgeSetBase<_Graph> > Parent;
+  template <typename GR>
+  class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
+
+  public:
+
+    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
 
     typedef typename Parent::Node Node;
@@ -1314,5 +1314,5 @@
     typedef typename Parent::Edge Edge;
 
-    typedef _Graph Graph;
+    typedef GR Graph;
 
   protected:
@@ -1335,5 +1335,5 @@
       typedef NodesImplBase Parent;
 
-      NodesImpl(const Graph& graph, SmartEdgeSet& arcset)
+      NodesImpl(const GR& graph, SmartEdgeSet& arcset)
         : Parent(graph), _arcset(arcset) {}
 
@@ -1375,5 +1375,5 @@
     };
 
-    NodesImpl nodes;
+    NodesImpl _nodes;
 
   public:
@@ -1382,6 +1382,6 @@
     ///
     /// Constructor of the EdgeSet.
-    SmartEdgeSet(const Graph& graph) : nodes(graph, *this) {
-      Parent::initalize(graph, nodes);
+    SmartEdgeSet(const GR& graph) : _nodes(graph, *this) {
+      Parent::initalize(graph, _nodes);
     }
 
@@ -1401,5 +1401,5 @@
     /// erased and it is not isolated in the EdgeSet.
     bool valid() const {
-      return nodes.attached();
+      return _nodes.attached();
     }
 
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 507)
+++ test/CMakeLists.txt	(revision 512)
@@ -11,5 +11,5 @@
 
 SET(TESTS
-#   adaptors_test
+  adaptors_test
   bfs_test
   circulation_test
@@ -19,5 +19,5 @@
   dijkstra_test
   dim_test
-#   edge_set_test
+  edge_set_test
   error_test
   graph_copy_test
Index: test/edge_set_test.cc
===================================================================
--- test/edge_set_test.cc	(revision 468)
+++ test/edge_set_test.cc	(revision 512)
@@ -34,5 +34,5 @@
 
 void checkSmartArcSet() {
-  checkConcept<concepts::Digraph, SmartArcSet<concepts::Digraph> >();
+  checkConcept<concepts::Digraph, SmartArcSet<ListDigraph> >();
 
   typedef ListDigraph Digraph;
@@ -100,5 +100,5 @@
 
 void checkListArcSet() {
-  checkConcept<concepts::Digraph, SmartArcSet<concepts::Digraph> >();
+  checkConcept<concepts::Digraph, SmartArcSet<ListDigraph> >();
 
   typedef ListDigraph Digraph;
@@ -180,5 +180,5 @@
 
 void checkSmartEdgeSet() {
-  checkConcept<concepts::Digraph, SmartEdgeSet<concepts::Digraph> >();
+  checkConcept<concepts::Digraph, SmartEdgeSet<ListDigraph> >();
 
   typedef ListDigraph Digraph;
@@ -264,5 +264,5 @@
 
 void checkListEdgeSet() {
-  checkConcept<concepts::Digraph, ListEdgeSet<concepts::Digraph> >();
+  checkConcept<concepts::Digraph, ListEdgeSet<ListDigraph> >();
 
   typedef ListDigraph Digraph;
