Changeset 1675:fa89ffb27a6d in lemon-0.x for test/maps_test.cc
- Timestamp:
- 09/08/05 16:34:50 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2193
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/maps_test.cc
r1435 r1675 10 10 struct A {}; 11 11 struct B {}; 12 class F 13 {12 13 class F { 14 14 public: 15 typedef A argument_type; 16 typedef B result_type; 17 15 18 B operator()(const A &) const {return B();} 16 19 }; 17 20 18 21 int func(A) {return 3;} 22 23 int binc(int, B) {return 4;} 19 24 20 25 typedef ReadMap<A,double> DoubleMap; … … 39 44 checkConcept<ReadMap<B,double>, ComposeMap<DoubleMap,ReadMap<B,A> > >(); 40 45 41 checkConcept<ReadMap<A,B>, FunctorMap< A,B,F> >();46 checkConcept<ReadMap<A,B>, FunctorMap<F, A, B> >(); 42 47 43 48 int a; … … 47 52 48 53 B b; 49 b=functorMap <A,B>(F())[A()];54 b=functorMap(F())[A()]; 50 55 51 a=functorMap <A,int>(&func)[A()];56 a=functorMap(&func)[A()]; 52 57 check(a==3,"Something is wrong with functorMap"); 58 59 a=combineMap(constMap<B, int, 1>(), identityMap<B>(), &binc)[B()]; 60 check(a==4,"Something is wrong with combineMap"); 61 53 62 54 63 std::cout << __FILE__ ": All tests passed.\n";
Note: See TracChangeset
for help on using the changeset viewer.