equal
deleted
inserted
replaced
|
1 |
|
2 // STLport regression testsuite component. |
|
3 // To compile as a separate example, please #define MAIN. |
|
4 |
|
5 #include <vector> |
|
6 #include <algorithm> |
|
7 #include <iostream> |
|
8 #include <cstdlib> |
|
9 |
|
10 #include "fadapter.h" |
|
11 |
|
12 #ifdef MAIN |
|
13 #define genern1_test main |
|
14 #endif |
|
15 |
|
16 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
17 using namespace std; |
|
18 #endif |
|
19 |
|
20 |
|
21 static int cxxrand() { return rand();} |
|
22 |
|
23 int genern1_test(int, char**) |
|
24 { |
|
25 cout<<"Results of genern1_test:"<<endl; |
|
26 |
|
27 #ifndef __STL_MEMBER_POINTER_PARAM_BUG //*TY 07/18/98 - added conditional |
|
28 // since ptr_gen() is not defined under this condition |
|
29 // (see xfunction.h) |
|
30 vector <int> v1(10); |
|
31 |
|
32 generate_n(v1.begin(), v1.size(), ptr_gen(cxxrand)); |
|
33 |
|
34 for(int i = 0; i < 10; i++) |
|
35 cout << v1[i] << ' '; |
|
36 cout << endl; |
|
37 #endif // __STL_MEMBER_POINTER_PARAM_BUG //*TY 07/18/98 - added |
|
38 |
|
39 return 0; |
|
40 } |