#include <iostream>
#include <vector>
#include <algorithm>    // std::remove_if
using namespace std;

template <typename T>
class check {
	public:
	virtual bool operator()(T x) = 0;
};

template <typename T>
struct cheat {
	cheat(check<T> *c)	 {_c = c;}
	bool operator()(T x) {return _c->operator ()(x);}
	check<T> *_c;
};

int main() {
	
	int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
   std::vector<int> v( array, array+10 );

   class even : public check<int>
   {
   	public:
    	virtual bool operator()( int x ) { cout<<"Hi"<<endl; return !( x % 2 ); }
   };
   even e;

   remove_if( v.begin(), v.end(),  cheat<int>(&e)); // no error
	
   return 0;
}