stdcpp/tsrc/Stdcpp_test/stlport/auto/stlport_bind/src/bind1st2.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 bind1st2_test main
       
    13 #endif
       
    14 
       
    15 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
       
    16 using namespace std;
       
    17 #endif
       
    18 int bind1st2_test(int, char**)
       
    19 {
       
    20 
       
    21 	cout<<"Results of bind1st2_test:"<<endl;
       
    22 	int array [3] = { 1, 2, 3 };
       
    23 
       
    24 	int* p = remove_if((int*)array, (int*)array + 3, bind1st(less<int>(), 2));
       
    25 	for(int* i = array; i != p; i++)
       
    26 		cout << *i << endl;
       
    27 	
       
    28 	if (*p == 3)
       
    29 	   return 0;
       
    30   	else
       
    31   	   return 1;
       
    32 }