diff --git a/research/try.cpp b/research/try.cpp index 077bd3e1a..ddfd21498 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -56,6 +56,8 @@ typedef unsigned int uint; #include //using lib::diff::GenNode; +using lib::meta::Types; +using lib::meta::NullType; using proc::control::CommandSignature; using proc::control::CommandDef; using lib::time::Time; @@ -68,30 +70,53 @@ using std::string; using VecS = vector; +template +struct TyS + { + using Seq = TyS; + }; + +template +struct ArgSeq; + +template +struct ArgSeq + { + using Seq = TyS; + }; + + template -void -operate (ARGS const& ...args) +struct Funny { - VecS strs = stringify (args...); - cout << join (strs); - } + static void + operate (ARGS const& ...args) + { + VecS strs = stringify (args...); + cout << join (strs); + } + + static string + capture (ARGS const& ...args) + { + VecS strs = stringify (args...); + return join (strs); + } + + static void + undo (ARGS const& ...args, string plonk) + { + VecS strs = stringify (args...); + cout << "UNDO..." << plonk << "args=" << join (strs); + } + }; template -string -capture (ARGS const& ...args) - { - VecS strs = stringify (args...); - return join (strs); - } +struct Funny> + : Funny + { }; -template -void -undo (ARGS const& ...args) - { - VecS strs = stringify (args...); - cout << "UNDO..." << join (strs); - } @@ -104,10 +129,10 @@ undo (ARGS const& ...args) int main (int, char**) { - cout << capture ("lalü", string("lala"), 12, 34L, 56.78) <::capture ("lalü", string("lala"), 12, 34L, 56.78) <; + auto ops = Funny::operate; using FunnySIG = lib::meta::_Fun::Sig; @@ -119,15 +144,18 @@ main (int, char**) SHOW_TYPE (SIG_Cap); SHOW_TYPE (SIG_Udo); + using ArgS = ArgSeq::Seq; + SHOW_TYPE (ArgS); + function funny; function capy; function undy; cout << "funny? " << bool(funny) <; - capy = capture; - undy = undo; + funny = Funny::operate; + capy = Funny::capture; + undy = Funny::undo; cout << "funny? " << bool(funny) <