COIN-OR::LEMON - Graph Library

Changeset 123:8899d1891a3c in lemon-main for test


Ignore:
Timestamp:
04/08/08 22:51:26 (17 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Small improvements in maps.h

  • Add a new version of constMap() function.
  • Fix in FunctorToMap? class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/maps_test.cc

    r94 r123  
    8484  {
    8585    checkConcept<ReadWriteMap<A,B>, ConstMap<A,B> >();
     86    checkConcept<ReadWriteMap<A,C>, ConstMap<A,C> >();
    8687    ConstMap<A,B> map1;
    8788    ConstMap<A,B> map2(B());
    8889    ConstMap<A,B> map3 = map1;
    8990    map1 = constMap<A>(B());
     91    map1 = constMap<A,B>();
    9092    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));
    9197
    9298    checkConcept<ReadWriteMap<A,int>, ConstMap<A,int> >();
     
    94100
    95101    checkConcept<ReadWriteMap<A,int>, ConstMap<A,Const<int,10> > >();
    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");
     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");
    100107  }
    101108
Note: See TracChangeset for help on using the changeset viewer.