lemon/maps.h
changeset 2080 630a5e16dc12
parent 2032 18c08f9129e4
child 2091 c8ccc1f8fd51
equal deleted inserted replaced
21:261948a3650f 22:16dc7328937c
   379     ///Constructor
   379     ///Constructor
   380 
   380 
   381     ///Constructor
   381     ///Constructor
   382     ///\param _m is the undelying map
   382     ///\param _m is the undelying map
   383     ///\param _v is the shift value
   383     ///\param _v is the shift value
   384     ShiftWriteMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
   384     ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
   385     Value operator[](Key k) const {return m[k] + v;}
   385     Value operator[](Key k) const {return m[k] + v;}
   386     void set(Key k, const Value& c) { m.set(k, c - v); }
   386     void set(Key k, const Value& c) { m.set(k, c - v); }
   387   };
   387   };
   388   
   388   
   389   ///Returns an \ref ShiftMap class
   389   ///Returns an \ref ShiftMap class