stdcpp/tsrc/Stdcpp_test/stlport/auto/stlport_bind/src/bind1st1.cpp
changeset 31 ce057bb09d0b
child 34 5fae379060a7
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 // STLport regression testsuite component.
       
    20 // To compile as a separate example, please #define MAIN.
       
    21 
       
    22 #include <iostream>
       
    23 #include <algorithm>
       
    24 #include <functional>
       
    25 
       
    26 
       
    27 
       
    28 #ifdef MAIN 
       
    29 #define bind1st1_test main
       
    30 #endif
       
    31 
       
    32 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
       
    33 using namespace std;
       
    34 #endif
       
    35 int bind1st1_test(int, char**)
       
    36 {
       
    37 
       
    38 	cout<<"Results of bind1st1_test:"<<endl;
       
    39 	int array [3] = { 1, 2, 3 };
       
    40 	int* p = remove_if((int*)array, (int*)array + 3, 
       
    41 		bind1st(less<int>(), 2));
       
    42 	for(int* i = array; i != p; i++)
       
    43 	{
       
    44 		cout << *i << endl;		
       
    45 	} 
       
    46 	
       
    47 	if (*p == 3)
       
    48 	   return 0;
       
    49   else
       
    50   return 1;
       
    51 }