diff -r c35afa9e89e7 -r ef88c0a30f85 lemon/bits/map_extender.h --- a/lemon/bits/map_extender.h Mon Jan 12 23:11:39 2009 +0100 +++ b/lemon/bits/map_extender.h Thu Nov 05 15:48:01 2009 +0100 @@ -36,17 +36,20 @@ // \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; typedef typename Parent::Value Value; + typedef typename Parent::Reference Reference; + typedef typename Parent::ConstReference ConstReference; + + typedef typename Parent::ReferenceMapTag ReferenceMapTag; class MapIt; class ConstMapIt; @@ -56,10 +59,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: @@ -75,9 +78,10 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -114,10 +118,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -145,10 +149,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -176,17 +180,20 @@ // \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; typedef typename Parent::Value Value; + typedef typename Parent::Reference Reference; + typedef typename Parent::ConstReference ConstReference; + + typedef typename Parent::ReferenceMapTag ReferenceMapTag; class MapIt; class ConstMapIt; @@ -196,10 +203,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: @@ -219,9 +226,9 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -258,10 +265,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -289,10 +296,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -316,7 +323,7 @@ private: - const Graph& graph; + const GraphType& graph; };