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

template <typename T>
class check {
	public:
	virtual bool operator()(T x) = 0;
	
	struct aid{
		aid(check *p){ _c = p;}
		check *_c;
		bool operator()(T x){
			return _c->operator ()(x);
		}
	};
	
	aid retMe(){
		return aid(this);
	}
};

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(), e.retMe()); // no error
	
   return 0;
}