Index: lemon/adaptors.h
===================================================================
--- lemon/adaptors.h	(revision 579)
+++ lemon/adaptors.h	(revision 617)
@@ -110,11 +110,9 @@
     template <typename V>
     class NodeMap : public DGR::template NodeMap<V> {
+      typedef typename DGR::template NodeMap<V> Parent;
+
     public:
-
-      typedef typename DGR::template NodeMap<V> Parent;
-
       explicit NodeMap(const Adaptor& adaptor)
         : Parent(*adaptor._digraph) {}
-
       NodeMap(const Adaptor& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) { }
@@ -135,11 +133,9 @@
     template <typename V>
     class ArcMap : public DGR::template ArcMap<V> {
+      typedef typename DGR::template ArcMap<V> Parent;
+
     public:
-
-      typedef typename DGR::template ArcMap<V> Parent;
-
       explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor)
         : Parent(*adaptor._digraph) {}
-
       ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) {}
@@ -256,6 +252,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+      typedef typename GR::template NodeMap<V> Parent;
+
     public:
-      typedef typename GR::template NodeMap<V> Parent;
       explicit NodeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -278,6 +275,7 @@
     template <typename V>
     class ArcMap : public GR::template ArcMap<V> {
+      typedef typename GR::template ArcMap<V> Parent;
+
     public:
-      typedef typename GR::template ArcMap<V> Parent;
       explicit ArcMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -299,6 +297,7 @@
     template <typename V>
     class EdgeMap : public GR::template EdgeMap<V> {
+      typedef typename GR::template EdgeMap<V> Parent;
+
     public:
-      typedef typename GR::template EdgeMap<V> Parent;
       explicit EdgeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -322,7 +321,7 @@
   template <typename DGR>
   class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
+    typedef DigraphAdaptorBase<DGR> Parent;
   public:
     typedef DGR Digraph;
-    typedef DigraphAdaptorBase<DGR> Parent;
   protected:
     ReverseDigraphBase() : Parent() { }
@@ -375,8 +374,8 @@
     public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
 #endif
+    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
   public:
     /// The type of the adapted digraph.
     typedef DGR Digraph;
-    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
   protected:
     ReverseDigraph() { }
@@ -404,4 +403,5 @@
   template <typename DGR, typename NF, typename AF, bool ch = true>
   class SubDigraphBase : public DigraphAdaptorBase<DGR> {
+    typedef DigraphAdaptorBase<DGR> Parent;
   public:
     typedef DGR Digraph;
@@ -410,5 +410,4 @@
 
     typedef SubDigraphBase Adaptor;
-    typedef DigraphAdaptorBase<DGR> Parent;
   protected:
     NF* _node_filter;
@@ -510,8 +509,9 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
 	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+	LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
+
     public:
       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)
@@ -536,8 +536,9 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
 	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
+
     public:
       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)
@@ -563,4 +564,5 @@
   class SubDigraphBase<DGR, NF, AF, false>
     : public DigraphAdaptorBase<DGR> {
+    typedef DigraphAdaptorBase<DGR> Parent;
   public:
     typedef DGR Digraph;
@@ -569,5 +571,4 @@
 
     typedef SubDigraphBase Adaptor;
-    typedef DigraphAdaptorBase<Digraph> Parent;
   protected:
     NF* _node_filter;
@@ -651,8 +652,9 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
           LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
+        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
+
     public:
       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)
@@ -677,8 +679,9 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
           LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
+        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
+
     public:
       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)
@@ -864,4 +867,5 @@
   template <typename GR, typename NF, typename EF, bool ch = true>
   class SubGraphBase : public GraphAdaptorBase<GR> {
+    typedef GraphAdaptorBase<GR> Parent;
   public:
     typedef GR Graph;
@@ -870,5 +874,4 @@
 
     typedef SubGraphBase Adaptor;
-    typedef GraphAdaptorBase<GR> Parent;
   protected:
 
@@ -1017,8 +1020,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
+
     public:
       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)
@@ -1043,8 +1047,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
+
     public:
       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)
@@ -1069,8 +1074,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
+
     public:
       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)
@@ -1097,4 +1103,5 @@
   class SubGraphBase<GR, NF, EF, false>
     : public GraphAdaptorBase<GR> {
+    typedef GraphAdaptorBase<GR> Parent;
   public:
     typedef GR Graph;
@@ -1103,5 +1110,4 @@
 
     typedef SubGraphBase Adaptor;
-    typedef GraphAdaptorBase<GR> Parent;
   protected:
     NF* _node_filter;
@@ -1212,8 +1218,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
+
     public:
       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)
@@ -1238,8 +1245,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
+
     public:
       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)
@@ -1264,8 +1272,9 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+	LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
+
     public:
       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)
@@ -1486,12 +1495,12 @@
                      true> > {
 #endif
-  public:
-
-    typedef GR Digraph;
-    typedef NF NodeFilterMap;
-
     typedef DigraphAdaptorExtender<
       SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
                      true> > Parent;
+
+  public:
+
+    typedef GR Digraph;
+    typedef NF NodeFilterMap;
 
     typedef typename Parent::Node Node;
@@ -1549,12 +1558,15 @@
                    true> > {
 
-  public:
-    typedef GR Graph;
-    typedef NF NodeFilterMap;
     typedef GraphAdaptorExtender<
       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
                    true> > Parent;
 
+  public:
+
+    typedef GR Graph;
+    typedef NF NodeFilterMap;
+
     typedef typename Parent::Node Node;
+
   protected:
     ConstMap<typename GR::Edge, Const<bool, true> > const_true_map;
@@ -1630,13 +1642,14 @@
                      AF, false> > {
 #endif
-  public:
+    typedef DigraphAdaptorExtender<
+      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
+                     AF, false> > Parent;
+
+  public:
+
     /// The type of the adapted digraph.
     typedef DGR Digraph;
     /// The type of the arc filter map.
     typedef AF ArcFilterMap;
-
-    typedef DigraphAdaptorExtender<
-      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
-                     AF, false> > Parent;
 
     typedef typename Parent::Arc Arc;
@@ -1739,13 +1752,14 @@
                    EF, false> > {
 #endif
-  public:
+    typedef GraphAdaptorExtender<
+      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
+                   EF, false> > Parent;
+
+  public:
+
     /// The type of the adapted graph.
     typedef GR Graph;
     /// The type of the edge filter map.
     typedef EF EdgeFilterMap;
-
-    typedef GraphAdaptorExtender<
-      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
-                   EF, false> > Parent;
 
     typedef typename Parent::Edge Edge;
@@ -2112,8 +2126,8 @@
     template <typename V>
     class NodeMap : public DGR::template NodeMap<V> {
+      typedef typename DGR::template NodeMap<V> Parent;
+
     public:
-
       typedef V Value;
-      typedef typename DGR::template NodeMap<Value> Parent;
 
       explicit NodeMap(const UndirectorBase<DGR>& adaptor)
@@ -2138,9 +2152,9 @@
     template <typename V>
     class ArcMap
-      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> >
-    {
+      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > {
+      typedef SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > Parent;
+
     public:
       typedef V Value;
-      typedef SubMapExtender<Adaptor, ArcMapBase<V> > Parent;
 
       explicit ArcMap(const UndirectorBase<DGR>& adaptor)
@@ -2164,8 +2178,8 @@
     template <typename V>
     class EdgeMap : public Digraph::template ArcMap<V> {
+      typedef typename Digraph::template ArcMap<V> Parent;
+
     public:
-
       typedef V Value;
-      typedef typename Digraph::template ArcMap<V> Parent;
 
       explicit EdgeMap(const UndirectorBase<DGR>& adaptor)
@@ -2239,8 +2253,8 @@
     public GraphAdaptorExtender<UndirectorBase<DGR> > {
 #endif
+    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   public:
     /// The type of the adapted digraph.
     typedef DGR Digraph;
-    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   protected:
     Undirector() { }
@@ -2450,7 +2464,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+      typedef typename GR::template NodeMap<V> Parent;
+
     public:
-
-      typedef typename GR::template NodeMap<V> Parent;
 
       explicit NodeMap(const OrienterBase<GR, DM>& adapter)
@@ -2475,7 +2489,7 @@
     template <typename V>
     class ArcMap : public GR::template EdgeMap<V> {
+      typedef typename Graph::template EdgeMap<V> Parent;
+
     public:
-
-      typedef typename Graph::template EdgeMap<V> Parent;
 
       explicit ArcMap(const OrienterBase<GR, DM>& adapter)
@@ -2547,4 +2561,5 @@
     public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
 #endif
+    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
   public:
 
@@ -2554,8 +2569,9 @@
     typedef DM DirectionMap;
 
-    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
     typedef typename Parent::Arc Arc;
+
   protected:
     Orienter() { }
+
   public:
 
@@ -2867,8 +2883,9 @@
   template <typename DGR>
   class SplitNodesBase {
+    typedef DigraphAdaptorBase<const DGR> Parent;
+
   public:
 
     typedef DGR Digraph;
-    typedef DigraphAdaptorBase<const DGR> Parent;
     typedef SplitNodesBase Adaptor;
 
@@ -3229,9 +3246,9 @@
     template <typename V>
     class NodeMap
-      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> >
-    {
+      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > {
+      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > Parent;
+
     public:
       typedef V Value;
-      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<Value> > Parent;
 
       NodeMap(const SplitNodesBase<DGR>& adaptor)
@@ -3255,9 +3272,9 @@
     template <typename V>
     class ArcMap
-      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> >
-    {
+      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > {
+      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > Parent;
+
     public:
       typedef V Value;
-      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<Value> > Parent;
 
       ArcMap(const SplitNodesBase<DGR>& adaptor)
@@ -3325,7 +3342,8 @@
     : public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
 #endif
+    typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
+
   public:
     typedef DGR Digraph;
-    typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
 
     typedef typename DGR::Node DigraphNode;
