6 //I did with g++ ver 3.0.4, suse 8.0
7 //If the template is removed from NodeMap, then it works well.
16 template <typename T> class NodeMap {
19 NodeMap(const ListGraph& _G) : G(_G) { }
24 template<typename Graph> class GraphWrapper {
28 GraphWrapper(Graph& _graph) : graph(&_graph) { }
30 template<typename T> class NodeMap : public Graph::NodeMap<T> {
32 NodeMap(const GraphWrapper<Graph>& _G) :
33 Graph::NodeMap<T>(*(_G.graph)) { }
37 template<typename Graph>
38 class ResGraphWrapper : public GraphWrapper<Graph> {
40 ResGraphWrapper(Graph& _graph) : GraphWrapper<Graph>(_graph) { }
43 template <typename Graph> class MaxFlow {
45 typedef ResGraphWrapper<const Graph> ResGW;
47 MaxFlow(const Graph& _g) : g(&_g) { }
48 void augmentOnShortestPath() {
50 typename ResGW::NodeMap<int> pred(res_graph);
54 int main(int, char **) {
56 MaxFlow<ListGraph> max_flow_test(G);
57 max_flow_test.augmentOnShortestPath();