lemon/iterable_maps.h
changeset 1760 f18e8ca73a8f
parent 1752 dce1f28ac595
child 1805 d284f81f02a5
equal deleted inserted replaced
2:d5a6cf0997ae 3:c351d75e187e
   273 
   273 
   274     typedef _Item Key;
   274     typedef _Item Key;
   275     typedef int Value;
   275     typedef int Value;
   276     typedef _Graph Graph;
   276     typedef _Graph Graph;
   277 
   277 
   278     IterableIntMap(const Graph& graph) : Parent(graph) {}
   278     explicit IterableIntMap(const Graph& graph) : Parent(graph) {}
   279 
   279 
   280   private:
   280   private:
   281     
   281     
   282     void unlace(const Key& key) {
   282     void unlace(const Key& key) {
   283       typename Parent::Value& node = Parent::operator[](key);
   283       typename Parent::Value& node = Parent::operator[](key);
   331 
   331 
   332       Reference& operator=(int value) { 
   332       Reference& operator=(int value) { 
   333 	_map.set(_key, value); 
   333 	_map.set(_key, value); 
   334 	return *this; 
   334 	return *this; 
   335       }
   335       }
       
   336       Reference& operator++() {
       
   337 	_map.set(_key, _map[_key] + 1); 
       
   338 	return *this; 	
       
   339       }
       
   340       int operator++(int) {
       
   341 	int value = _map[_key];
       
   342 	_map.set(_key, value + 1); 
       
   343 	return value; 	
       
   344       }
       
   345       Reference& operator--() {
       
   346 	_map.set(_key, _map[_key] - 1); 
       
   347 	return *this; 	
       
   348       }
       
   349       int operator--(int) {
       
   350 	int value = _map[_key];
       
   351 	_map.set(_key, value - 1); 
       
   352 	return value; 	
       
   353       }
   336       Reference& operator+=(int value) { 
   354       Reference& operator+=(int value) { 
   337 	_map.set(_key, _map[_key] + value); 
   355 	_map.set(_key, _map[_key] + value); 
   338 	return *this;
   356 	return *this;
   339       }
   357       }
   340       Reference& operator-=(int value) { 
   358       Reference& operator-=(int value) {