COIN-OR::LEMON - Graph Library

Changeset 209:9a37b8d02d74 in lemon-0.x


Ignore:
Timestamp:
03/19/04 21:58:39 (21 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@304
Message:

get() -> operator[]()

Location:
src/work/alpar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/mapskeleton.h

    r186 r209  
    1919   
    2020    ///Reads an element of the map.
    21     ValueType get(const KeyType &i) const {return ValueType();}
     21    ValueType operator[](const KeyType &i) const {return ValueType();}
    2222  };
    2323
     
    7171
    7272    ///Give a reference to the value belonging to a key.
    73     ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
    74     //    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
     73    ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
     74    ///Give a const reference to the value belonging to a key.
     75    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
    7576  };
    7677
  • src/work/alpar/smart_graph.h

    r187 r209  
    375375     
    376376      void set(Node n, T a) { container[n.n]=a; }
    377       T get(Node n) const { return container[n.n]; }
     377      //T get(Node n) const { return container[n.n]; }
    378378      T& operator[](Node n) { return container[n.n]; }
    379379      const T& operator[](Node n) const { return container[n.n]; }
     
    462462     
    463463      void set(Edge n, T a) { container[n.n]=a; }
    464       T get(Edge n) const { return container[n.n]; }
     464      //T get(Edge n) const { return container[n.n]; }
    465465      T& operator[](Edge n) { return container[n.n]; }
    466466      const T& operator[](Edge n) const { return container[n.n]; }
     
    604604     
    605605      void set(Edge n, T a) { container[n.idref()/2]=a; }
    606       T get(Edge n) const { return container[n.idref()/2]; }
     606      //T get(Edge n) const { return container[n.idref()/2]; }
    607607      T& operator[](Edge n) { return container[n.idref()/2]; }
    608608      const T& operator[](Edge n) const { return container[n.idref()/2]; }
Note: See TracChangeset for help on using the changeset viewer.