diff --git a/lemon/bits/graph_extender.h b/lemon/bits/graph_extender.h --- a/lemon/bits/graph_extender.h +++ b/lemon/bits/graph_extender.h @@ -37,9 +37,10 @@ // \brief Extender for the digraph implementations template class DigraphExtender : public Base { + typedef Base Parent; + public: - typedef Base Parent; typedef DigraphExtender Digraph; // Base extensions @@ -55,11 +56,11 @@ return Parent::maxArcId(); } - Node fromId(int id, Node) const { + static Node fromId(int id, Node) { return Parent::nodeFromId(id); } - Arc fromId(int id, Arc) const { + static Arc fromId(int id, Arc) { return Parent::arcFromId(id); } @@ -218,10 +219,9 @@ template class NodeMap : public MapExtender > { - public: - typedef DigraphExtender Digraph; typedef MapExtender > Parent; + public: explicit NodeMap(const Digraph& digraph) : Parent(digraph) {} NodeMap(const Digraph& digraph, const _Value& value) @@ -243,10 +243,9 @@ template class ArcMap : public MapExtender > { - public: - typedef DigraphExtender Digraph; typedef MapExtender > Parent; + public: explicit ArcMap(const Digraph& digraph) : Parent(digraph) {} ArcMap(const Digraph& digraph, const _Value& value) @@ -330,9 +329,10 @@ // \brief Extender for the Graphs template class GraphExtender : public Base { + typedef Base Parent; + public: - typedef Base Parent; typedef GraphExtender Graph; typedef True UndirectedTag; @@ -355,15 +355,15 @@ return Parent::maxEdgeId(); } - Node fromId(int id, Node) const { + static Node fromId(int id, Node) { return Parent::nodeFromId(id); } - Arc fromId(int id, Arc) const { + static Arc fromId(int id, Arc) { return Parent::arcFromId(id); } - Edge fromId(int id, Edge) const { + static Edge fromId(int id, Edge) { return Parent::edgeFromId(id); } @@ -601,11 +601,10 @@ template class NodeMap : public MapExtender > { - public: - typedef GraphExtender Graph; typedef MapExtender > Parent; - NodeMap(const Graph& graph) + public: + explicit NodeMap(const Graph& graph) : Parent(graph) {} NodeMap(const Graph& graph, const _Value& value) : Parent(graph, value) {} @@ -626,11 +625,10 @@ template class ArcMap : public MapExtender > { - public: - typedef GraphExtender Graph; typedef MapExtender > Parent; - ArcMap(const Graph& graph) + public: + explicit ArcMap(const Graph& graph) : Parent(graph) {} ArcMap(const Graph& graph, const _Value& value) : Parent(graph, value) {} @@ -651,11 +649,10 @@ template class EdgeMap : public MapExtender > { - public: - typedef GraphExtender Graph; typedef MapExtender > Parent; - EdgeMap(const Graph& graph) + public: + explicit EdgeMap(const Graph& graph) : Parent(graph) {} EdgeMap(const Graph& graph, const _Value& value)