diff --git a/research/try.cpp b/research/try.cpp index 9a2a8a207..06a602aa9 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -52,16 +52,19 @@ typedef unsigned int uint; #include "lib/format-cout.hpp" #include "lib/format-util.hpp" -#include "lib/meta/function.hpp" +//#include "lib/meta/function.hpp" +#include "lib/meta/tuple-helper.hpp" #include +#include #include using lib::meta::_Fun; using std::function; -using std::string; +using std::forward; using std::move; +using std::string; @@ -70,11 +73,66 @@ using std::move; cout << "typeof( " << STRINGIFY(_TY_) << " )= " << lib::meta::typeStr<_TY_>() < +struct Idx + { }; + +template +struct IdxSeq + { + template + struct First + { + + }; + }; + +template +struct Pick + { + template + Pick (ARGS... args) + { } + }; + +template +void +dispatch (Idx, ARGS...args) + { + + fun1 (Pick{args...} ...); + } + +template +void +dispatch (ARGS...args) + { + using First = typename IdxSeq::template First<3>; + + dispatch_ (First{}, args...); + } int main (int, char**) { + fun1 (1,2,3); + fun2 (4,5,6); + +// dispatch (2,3,4,5,6,7,8); cout << "\n.gulp.\n";