diff --git a/research/try.cpp b/research/try.cpp index a4b034715..b65508ba2 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -59,6 +59,46 @@ using std::bind; using std::string; using std::tuple; +////////////////############# Investigation of implementation variants +namespace lib { +namespace meta { + + template< typename RET, class CLASS + , typename A1 + > + struct _Fun + { + typedef RET Ret; + typedef Types Args; + typedef RET Sig(CLASS* const, A1); + }; + + template< typename RET, class CLASS + , typename A1 + > + struct _Fun + { + typedef RET Ret; + typedef Types Args; + typedef RET Sig(CLASS* const, A1); + }; + + template< typename RET, class CLASS + , typename A1 + , typename A2 + > + struct _Fun + { + typedef RET Ret; + typedef Types Args; + typedef RET Sig(CLASS* const, A1,A2); + }; + +}}//namespace lib::meta +////////////////############# Investigation of implementation variants + + + int funny (uint i) { @@ -128,12 +168,19 @@ main (int, char**) Fun f6{bind (f5, funk, _1)}; + auto lambda = [&](uint ii) { return funk.fun(ii); }; showType (funny); showType (&funny); showType (Funky::notfunny); showType (memfunP); + showType (lambda); + + cout << "\n\n-------\n"; + + SHOW_TYPE (decltype(&Funky::operator())); + SHOW_TYPE (decltype(lambda)); cout << "\n.gulp.\n"; diff --git a/src/lib/meta/function.hpp b/src/lib/meta/function.hpp index e6b43e2a3..34d831dfd 100644 --- a/src/lib/meta/function.hpp +++ b/src/lib/meta/function.hpp @@ -262,7 +262,7 @@ namespace meta{ }; /** Specialisations for member function pointers */ - template +/* template struct _Fun { typedef RET Ret; @@ -376,7 +376,7 @@ namespace meta{ typedef Types Args; typedef RET Sig(CLASS* const, A1,A2,A3,A4,A5,A6,A7,A8); }; - +*/ template