equal
deleted
inserted
replaced
|
1 |
|
2 // STLport regression testsuite component. |
|
3 // To compile as a separate example, please #define MAIN. |
|
4 |
|
5 #include <iostream> |
|
6 #include <set> |
|
7 |
|
8 #ifdef MAIN |
|
9 #define mset3_test main |
|
10 #endif |
|
11 |
|
12 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
13 using namespace std; |
|
14 #endif |
|
15 int mset3_test(int, char**) |
|
16 { |
|
17 cout<<"Results of mset3_test:"<<endl; |
|
18 int array [] = { 3, 6, 1, 2, 3, 2, 6, 7, 9 }; |
|
19 int failures = 0; |
|
20 multiset<int, less<int> > s(array, array + 9); |
|
21 std::multiset<int, less<int> >::iterator i; |
|
22 i = s.lower_bound(3); |
|
23 cout << "lower bound = " << *i << endl; |
|
24 if (*i != 3) |
|
25 failures++; |
|
26 i = s.upper_bound(3); |
|
27 cout << "upper bound = " << *i << endl; |
|
28 if (*i != 6) |
|
29 failures++; |
|
30 return failures; |
|
31 } |