I'm trying to figure out how could many boost classes be able to accept a function signature as template argument and then "extract" from there the result type, first argument type and so on.
template <class Signature>
class myfunction_ptr
{
Signature* fn_ptr;
public:
typedef /*something*/ result_type; // How can I define this?
typedef /*something*/ arg1_type; // And this?
};
I know that boost also provides a more portable implementation, using a template argument for each function argument and that's easy to understand. Can someone explain me the magic beyond this?