get() -> operator[]()
authoralpar
Fri, 19 Mar 2004 20:58:39 +0000
changeset 2099a37b8d02d74
parent 208 1e36245f905d
child 210 6bc65a8a99c6
get() -> operator[]()
src/work/alpar/mapskeleton.h
src/work/alpar/smart_graph.h
     1.1 --- a/src/work/alpar/mapskeleton.h	Fri Mar 19 15:41:58 2004 +0000
     1.2 +++ b/src/work/alpar/mapskeleton.h	Fri Mar 19 20:58:39 2004 +0000
     1.3 @@ -18,7 +18,7 @@
     1.4      ReadMapSkeleton() {}
     1.5      
     1.6      ///Reads an element of the map.
     1.7 -    ValueType get(const KeyType &i) const {return ValueType();}
     1.8 +    ValueType operator[](const KeyType &i) const {return ValueType();}
     1.9    };
    1.10  
    1.11  
    1.12 @@ -70,8 +70,9 @@
    1.13      ReferenceMapSkeleton(const ValueType &t) : ReadWriteMapSkeleton(t) {}    
    1.14  
    1.15      ///Give a reference to the value belonging to a key.
    1.16 -    ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
    1.17 -    //    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
    1.18 +    ValueType &operator[](const KeyType &i) {return *(ValueType*)0;} 
    1.19 +    ///Give a const reference to the value belonging to a key.
    1.20 +    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
    1.21    };
    1.22  
    1.23  
     2.1 --- a/src/work/alpar/smart_graph.h	Fri Mar 19 15:41:58 2004 +0000
     2.2 +++ b/src/work/alpar/smart_graph.h	Fri Mar 19 20:58:39 2004 +0000
     2.3 @@ -374,7 +374,7 @@
     2.4        void erase(const Node k) { }
     2.5        
     2.6        void set(Node n, T a) { container[n.n]=a; }
     2.7 -      T get(Node n) const { return container[n.n]; }
     2.8 +      //T get(Node n) const { return container[n.n]; }
     2.9        T& operator[](Node n) { return container[n.n]; }
    2.10        const T& operator[](Node n) const { return container[n.n]; }
    2.11  
    2.12 @@ -461,7 +461,7 @@
    2.13        void erase(const Edge k) { }
    2.14        
    2.15        void set(Edge n, T a) { container[n.n]=a; }
    2.16 -      T get(Edge n) const { return container[n.n]; }
    2.17 +      //T get(Edge n) const { return container[n.n]; }
    2.18        T& operator[](Edge n) { return container[n.n]; }
    2.19        const T& operator[](Edge n) const { return container[n.n]; }
    2.20  
    2.21 @@ -603,7 +603,7 @@
    2.22        void erase(const Edge k) { }
    2.23        
    2.24        void set(Edge n, T a) { container[n.idref()/2]=a; }
    2.25 -      T get(Edge n) const { return container[n.idref()/2]; }
    2.26 +      //T get(Edge n) const { return container[n.idref()/2]; }
    2.27        T& operator[](Edge n) { return container[n.idref()/2]; }
    2.28        const T& operator[](Edge n) const { return container[n.idref()/2]; }
    2.29