COIN-OR::LEMON - Graph Library

Changes in / [124:ae7785fe8431:122:35840c5aa696] in lemon-1.1


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/maps.h

    r123 r104  
    117117
    118118    /// Constructor with specified initial value.
    119     /// \param v The initial value of the map.
     119    /// \param v is the initial value of the map.
    120120    ConstMap(const Value &v) : _value(v) {}
    121121
     
    142142  inline ConstMap<K, V> constMap(const V &v) {
    143143    return ConstMap<K, V>(v);
    144   }
    145 
    146   template<typename K, typename V>
    147   inline ConstMap<K, V> constMap() {
    148     return ConstMap<K, V>();
    149144  }
    150145
     
    619614           typename V = typename F::result_type>
    620615  class FunctorToMap : public MapBase<K, V> {
    621     F _f;
     616    const F &_f;
    622617  public:
    623618    typedef MapBase<K, V> Parent;
  • test/maps_test.cc

    r123 r94  
    8484  {
    8585    checkConcept<ReadWriteMap<A,B>, ConstMap<A,B> >();
    86     checkConcept<ReadWriteMap<A,C>, ConstMap<A,C> >();
    8786    ConstMap<A,B> map1;
    8887    ConstMap<A,B> map2(B());
    8988    ConstMap<A,B> map3 = map1;
    9089    map1 = constMap<A>(B());
    91     map1 = constMap<A,B>();
    9290    map1.setAll(B());
    93     ConstMap<A,C> map4(C(1));
    94     ConstMap<A,C> map5 = map4;
    95     map4 = constMap<A>(C(2));
    96     map4.setAll(C(3));
    9791
    9892    checkConcept<ReadWriteMap<A,int>, ConstMap<A,int> >();
     
    10094
    10195    checkConcept<ReadWriteMap<A,int>, ConstMap<A,Const<int,10> > >();
    102     ConstMap<A,Const<int,10> > map6;
    103     ConstMap<A,Const<int,10> > map7 = map6;
    104     map6 = constMap<A,int,10>();
    105     map7 = constMap<A,Const<int,10> >();
    106     check(map6[A()] == 10 && map7[A()] == 10, "Something is wrong with ConstMap");
     96    ConstMap<A,Const<int,10> > map4;
     97    ConstMap<A,Const<int,10> > map5 = map4;
     98    map4 = map5;
     99    check(map4[A()] == 10 && map5[A()] == 10, "Something is wrong with ConstMap");
    107100  }
    108101
Note: See TracChangeset for help on using the changeset viewer.