Im doing a bit crazy project so dont get scared Im creating some kind of lambda calculus in CPP. Anyway how do I make it work?
auto INC_ = [=](void *arg, void *(*n)(void*, void*))-> void * {return n(arg,arg); };
auto do_ = [=](void *arg1, void *arg2)-> void * {return arg1; };
INC(a,do_);
INC_ gets 2 arg however second arg is a lambda exp with 2 other arguments.
do_ do what must be done with 2 arg
However if I try to call it all together like in 3 line. I get wrong arguments error.
So the real question is how to pass 2 arg lambda so it executes properly?
void*s? C++ has a type system that is pretty useful.