#include
#include
#include
#include
using namespace std;
template
void print(T& c){
for( typename T::iterator i = c.begin(); i != c.end(); i++ ){
std::cout << *i << endl;
}
}
template
OutputIterator copy_if( InputIterator start, InputIterator stop,OutputIterator out, Predicate select ){
while( start != stop ){
if( select( *start ) )
*out++ = *start;
++start;
}
return out;
}
int main( )
{
const int numbers = 7;
const int num[numbers] = { -5, 0, 13, 20, 10, 4, -1 };
vector v1( num, num+numbers );
print( v1 );
vector v2( num, num+numbers );
vector::const_iterator v2_copy_end = remove_copy_if( v1.begin(), v1.end(), v2.begin(),not1( bind2nd( greater(), 10 ) ) );
for( vector::const_iterator i = v2.begin(); i != v2_copy_end;++i )
cout << *i << " ";
}