#include "cpjit.h" #include using namespace cpjit; using namespace std; int main (void) { env e ("/tmp/libcpjit"); funbuild2 fb (e); fb << "return ((int *)a1)[0] + a2;"; fun2 &f = *fb.get (); funbuild2 fb2 (e); fb2 << "return ((int *)a1)[0] - a2;"; fun2 &f2 = *fb2.get (); int i = 3; cout << f (&i, 2) << endl; cout << f2 (&i, 2) << endl; return 0; }