I'd like to know if it's possible to create a templated function that takes a function pointer as an argument, and uses static ifs to generate different behaviors based on the type signature of the function pointer.

More specifically, I want to create code generation functions for my JIT compiler, and template them based on a pointer to a function that implements the semantics of the operation being jitted. Not all of these operations take the same arguments, so I'd like to be able to template and generate different machine code.

Is it possible to template based on a function pointer argument? If so, is it possible to use static ifs to know the return type or the argument types of the function pointer's signature, as well as how many arguments it takes?

Reply via email to