Skip to content

Instantly share code, notes, and snippets.

@deoxxa
Created December 14, 2010 13:20
Show Gist options
  • Save deoxxa/740389 to your computer and use it in GitHub Desktop.
Save deoxxa/740389 to your computer and use it in GitHub Desktop.
Template madness!
template <class R> struct functor0 { typedef R (*type)(); };
template <class R, class A0> struct functor1 { typedef R (*type)(A0 a0); };
template <class R, class A0, class A1> struct functor2 { typedef R (*type)(A0 a0, A1 a1); };
template <class R, class A0, class A1, class A2> struct functor3 { typedef R (*type)(A0 a0, A1 a1, A2 a2); };
template <class R, class A0, class A1, class A2, class A3> struct functor4 { typedef R (*type)(A0 a0, A1 a1, A2 a2, A3 a3); };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment