1 #include "algostuff.hpp"
 2 using namespace std;
 3 
 4 bool bothEvenOrOdd (int elem1, int elem2)
 5 {
 6     return elem1 % 2 == elem2 % 2;
 7 }
 8 
 9 int main()
10 {
11     vector<int> coll1;
12     list<int> coll2;
13 
14     float m = 40.0f;
15 
16     INSERT_ELEMENTS(coll1,1,7);
17     INSERT_ELEMENTS(coll2,3,9);
18 
19     PRINT_ELEMENTS(coll1,"coll1: \n");
20     PRINT_ELEMENTS(coll2,"coll2: \n");
21 
22     // check whether both collections are equal
23     if (equal (coll1.begin(), coll1.end(),  // first range
24                coll2.begin())) {            // second range
25         cout << "coll1 == coll2" << endl;
26     } /* TODO Shouldn't there be an 'else' case? */
27 
28     // check for corresponding even and odd elements
29     if (equal (coll1.begin(), coll1.end(),  // first range
30                coll2.begin(),               // second range
31                bothEvenOrOdd)) {            // comparison criterion
32         cout << "even and odd elements correspond" << endl;
33     }
34 }