text: #include<iostream>
  #include "stub.h"
  using namespace std;
  class A{
      int i;
  public:
      virtual int foo(int a){
          cout<<"I am A_foo"<<endl;
          return 0;
      }
  };
  
  int foo_stub(void* obj, int a)
  {   
      A* o= (A*)obj;
      cout<<"I am foo_stub"<<endl;
      return 0;
  }
  
  
  int main()
  {
      typedef int (*fptr)(A*,int);
      fptr A_foo = (fptr)(&A::foo);
      Stub stub;
      stub.set(A_foo, foo_stub);
      A a;
      a.foo(1);
      return 0;
  }