COIN-OR::LEMON - Graph Library

Changeset 1759:0bb3fb3baffd in lemon-0.x


Ignore:
Timestamp:
11/04/05 11:55:13 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2291
Message:

Increment and decrement operator for IterableIntMap::Reference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/iterable_maps.h

    r1752 r1759  
    276276    typedef _Graph Graph;
    277277
    278     IterableIntMap(const Graph& graph) : Parent(graph) {}
     278    explicit IterableIntMap(const Graph& graph) : Parent(graph) {}
    279279
    280280  private:
     
    334334        return *this;
    335335      }
     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      }
    336354      Reference& operator+=(int value) {
    337355        _map.set(_key, _map[_key] + value);
Note: See TracChangeset for help on using the changeset viewer.