.
authormarci
Mon, 22 Mar 2004 15:53:05 +0000
changeset 232cb87fb9d4c94
parent 231 f62f11c9e6df
child 233 57ef4fd493d5
.
src/work/list_graph.h
     1.1 --- a/src/work/list_graph.h	Mon Mar 22 13:08:24 2004 +0000
     1.2 +++ b/src/work/list_graph.h	Mon Mar 22 15:53:05 2004 +0000
     1.3 @@ -45,8 +45,9 @@
     1.4  	G(_G), container(G.node_id, a) { }
     1.5        void set(Node n, T a) { container[/*G.id(n)*/n.node->id]=a; }
     1.6        T get(Node n) const { return container[/*G.id(n)*/n.node->id]; }
     1.7 -      T& operator[](Node n) { return container[/*G.id(n)*/n.node->id]; }
     1.8 -      const T& operator[](Node n) const { 
     1.9 +      std::vector<T>::reference operator[](Node n) { 
    1.10 +	return container[/*G.id(n)*/n.node->id]; }
    1.11 +      std::vector<T>::const_reference operator[](Node n) const { 
    1.12  	return container[/*G.id(n)*/n.node->id]; 
    1.13        }
    1.14        void update() { container.resize(G.node_id); }
    1.15 @@ -65,8 +66,9 @@
    1.16  	G(_G), container(G.edge_id, a) { }
    1.17        void set(Edge e, T a) { container[/*G.id(e)*/e.edge->id]=a; }
    1.18        T get(Edge e) const { return container[/*G.id(e)*/e.edge->id]; }
    1.19 -      T& operator[](Edge e) { return container[/*G.id(e)*/e.edge->id]; } 
    1.20 -      const T& operator[](Edge e) const { 
    1.21 +      std::vector<T>::reference operator[](Edge e) { 
    1.22 +	return container[/*G.id(e)*/e.edge->id]; } 
    1.23 +      std::vector<T>::const_reference operator[](Edge e) const { 
    1.24  	return container[/*G.id(e)*/e.edge->id]; 
    1.25        } 
    1.26        void update() { container.resize(G.edge_id); }