diff --git a/lemon/bits/map_extender.h b/lemon/bits/map_extender.h --- a/lemon/bits/map_extender.h +++ b/lemon/bits/map_extender.h @@ -36,13 +36,12 @@ // \brief Extender for maps template class MapExtender : public _Map { + typedef _Map Parent; + typedef typename Parent::GraphType GraphType; + public: - typedef _Map Parent; typedef MapExtender Map; - - - typedef typename Parent::Graph Graph; typedef typename Parent::Key Item; typedef typename Parent::Key Key; @@ -58,10 +57,10 @@ public: - MapExtender(const Graph& graph) + MapExtender(const GraphType& graph) : Parent(graph) {} - MapExtender(const Graph& graph, const Value& value) + MapExtender(const GraphType& graph, const Value& value) : Parent(graph, value) {} private: @@ -77,9 +76,10 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -116,10 +116,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -147,10 +147,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -178,13 +178,12 @@ // \brief Extender for maps which use a subset of the items. template class SubMapExtender : public _Map { + typedef _Map Parent; + typedef _Graph GraphType; + public: - typedef _Map Parent; typedef SubMapExtender Map; - - typedef _Graph Graph; - typedef typename Parent::Key Item; typedef typename Parent::Key Key; @@ -200,10 +199,10 @@ public: - SubMapExtender(const Graph& _graph) + SubMapExtender(const GraphType& _graph) : Parent(_graph), graph(_graph) {} - SubMapExtender(const Graph& _graph, const Value& _value) + SubMapExtender(const GraphType& _graph, const Value& _value) : Parent(_graph, _value), graph(_graph) {} private: @@ -223,9 +222,9 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -262,10 +261,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -293,10 +292,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -320,7 +319,7 @@ private: - const Graph& graph; + const GraphType& graph; };