lemon/maps.h
changeset 30 72364ba3466d
parent 29 0cb4ba427bfd
child 33 d794ec195ec0
equal deleted inserted replaced
2:c94743e5b72e 3:9a1dbb5e8e6f
  1349       : container(_container), functor(_functor) {}
  1349       : container(_container), functor(_functor) {}
  1350 
  1350 
  1351     /// The \c set function of the map
  1351     /// The \c set function of the map
  1352     void set(const Key& key, Value value) {
  1352     void set(const Key& key, Value value) {
  1353       if (value) {
  1353       if (value) {
  1354 	container.push_front(key);
  1354 	container.push_front(functor(key));
  1355       }
  1355       }
  1356     }
  1356     }
  1357     
  1357     
  1358   private:
  1358   private:
  1359     Container& container;    
  1359     Container& container;    
  1406       : container(_container), it(_container.end()), functor(_functor) {}
  1406       : container(_container), it(_container.end()), functor(_functor) {}
  1407 
  1407 
  1408     /// The \c set function of the map
  1408     /// The \c set function of the map
  1409     void set(const Key& key, Value value) {
  1409     void set(const Key& key, Value value) {
  1410       if (value) {
  1410       if (value) {
  1411 	it = container.insert(it, key);
  1411 	it = container.insert(it, functor(key));
  1412         ++it;
  1412         ++it;
  1413       }
  1413       }
  1414     }
  1414     }
  1415     
  1415     
  1416   private:
  1416   private: