31
|
1 |
|
|
2 |
|
|
3 |
// STLport regression testsuite component.
|
|
4 |
// To compile as a separate example, please #define MAIN.
|
|
5 |
|
|
6 |
#include <iostream>
|
|
7 |
#include <algorithm>
|
|
8 |
#include <functional>
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
#ifdef MAIN
|
|
13 |
#define bind1st1_test main
|
|
14 |
#endif
|
|
15 |
|
|
16 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
17 |
using namespace std;
|
|
18 |
#endif
|
|
19 |
int bind1st1_test(int, char**)
|
|
20 |
{
|
|
21 |
|
|
22 |
cout<<"Results of bind1st1_test:"<<endl;
|
|
23 |
int array [3] = { 1, 2, 3 };
|
|
24 |
int* p = remove_if((int*)array, (int*)array + 3,
|
|
25 |
bind1st(less<int>(), 2));
|
|
26 |
for(int* i = array; i != p; i++)
|
|
27 |
{
|
|
28 |
cout << *i << endl;
|
|
29 |
}
|
|
30 |
|
|
31 |
if (*p == 3)
|
|
32 |
return 0;
|
|
33 |
else
|
|
34 |
return 1;
|
|
35 |
}
|