From 794e70a64b528fef5aea8d9fb01ee36171265f95 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 4 Sep 2015 17:14:11 +0200 Subject: [PATCH] augment function type rebinding helper allow to pick the bare function signature from any "function like" entity Note: we're still unsing our own Typelist construct to represent the function argument types. Since we're now using C++11, this could be replaced by varargs, and we could get rid of those various overloads for different numbers of arguments. Unfortunately this transition is linked to the usage of argument tuples in our command framework (which could then be replaced by std::tuple), and this is still a bit of rather technical work, which I do not want to spend much time on right now --- src/lib/meta/function.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/meta/function.hpp b/src/lib/meta/function.hpp index 877b493c6..485f489c0 100644 --- a/src/lib/meta/function.hpp +++ b/src/lib/meta/function.hpp @@ -222,6 +222,7 @@ namespace meta{ { typedef typename FunctionSignature >::Ret Ret; typedef typename FunctionSignature >::Args Args; + typedef SIG Sig; }; /** Specialisation for using a function pointer */ template @@ -229,6 +230,7 @@ namespace meta{ { typedef typename FunctionSignature >::Ret Ret; typedef typename FunctionSignature >::Args Args; + typedef SIG Sig; }; /** Specialisation when using a function reference */ template @@ -236,6 +238,7 @@ namespace meta{ { typedef typename FunctionSignature >::Ret Ret; typedef typename FunctionSignature >::Args Args; + typedef SIG Sig; }; /** Specialisation for passing a functor */ template @@ -243,6 +246,7 @@ namespace meta{ { typedef typename FunctionSignature >::Ret Ret; typedef typename FunctionSignature >::Args Args; + typedef SIG Sig; }; /** Specialisations for member function pointers */ @@ -251,6 +255,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const); }; template< typename RET, class CLASS @@ -270,6 +275,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2); }; template< typename RET, class CLASS @@ -281,6 +287,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3); }; template< typename RET, class CLASS @@ -293,6 +300,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3,A4); }; template< typename RET, class CLASS @@ -306,6 +314,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3,A4,A5); }; template< typename RET, class CLASS @@ -320,6 +329,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3,A4,A5,A6); }; template< typename RET, class CLASS @@ -335,6 +345,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3,A4,A5,A6,A7); }; template< typename RET, class CLASS @@ -351,6 +362,7 @@ namespace meta{ { typedef RET Ret; typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2,A3,A4,A5,A6,A7,A8); };