stdcpp/tsrc/Stdcpp_test/stlport/auto/stlport_bind/src/bind2nd1.cpp
changeset 0 e4d67989cc36
child 18 47c74d1534e1
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 #ifdef MAIN 
       
    12 #define bind2nd1_test main
       
    13 #endif
       
    14 
       
    15 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
       
    16 using namespace std;
       
    17 #endif
       
    18 int bind2nd1_test(int, char**)
       
    19 {
       
    20 
       
    21 	cout<<"Results of bind2nd1_test:"<<endl;
       
    22 	int array [3] = { 1, 2, 3 };
       
    23 
       
    24 	replace_if(array, array + 3, 
       
    25 	binder2nd<greater<int> >(greater<int>(), 2), 4);
       
    26 	for(int i = 0; i < 3; i++)
       
    27 	cout << array[i] << endl;
       
    28 
       
    29 	if((array[0] == 1) && (array[1] == 2) && (array[2] == 4))
       
    30 	   return 0;
       
    31   	else
       
    32   		return 1;
       
    33 }