diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp index a01079ee8..56085e74d 100644 --- a/src/proc/control/command-closure.hpp +++ b/src/proc/control/command-closure.hpp @@ -192,8 +192,9 @@ namespace control { function unboundF (unboundFunctor.getFun()); TupleApplicator appli (params_); - function boundFunctor = appli.bind (unboundF); - return CmdFunctor (boundFunctor); +// function boundFunctor = appli.bind (unboundF); ///////TODO: deactivated temporarily + function boundFun; + return CmdFunctor (boundFun); } diff --git a/tests/lib/meta/function-closure-test.cpp b/tests/lib/meta/function-closure-test.cpp index b0be3edb5..1eeb7b634 100644 --- a/tests/lib/meta/function-closure-test.cpp +++ b/tests/lib/meta/function-closure-test.cpp @@ -32,8 +32,10 @@ #include "lib/test/run.hpp" +#include "lib/meta/typelist.hpp" ////////////TODO really? #include "lib/meta/function-closure.hpp" #include "meta/dummy-functions.hpp" +#include "meta/typelist-diagnostics.hpp" //#include "lib/util.hpp" //#include @@ -47,21 +49,78 @@ using std::cout; namespace lumiera { namespace typelist{ namespace test { - - - - + + + namespace { // test data + + + + typedef Types< Num<1> + , Num<2> + , Num<3> + >::List List1; + typedef Types< Num<5> + , Num<6> + , Num<7> + >::List List2; + + + /** special test fun + * accepting the terrific Num types */ + template + int + getNumberz (Num one, Num two, Num three) + { + return one.o_ + two.o_ + three.o_; + } + + } // (End) test data + + + + + + /************************************************************************* - * @test ////////////////////////////////////////// - * - building combinations and permutations + * @test building a function closure for a given functor + * and arguments passed in as tuple + * //////////////////////////////////////////TODO + * - building */ class FunctionClosure_test : public Test { virtual void run (Arg) { + check_diagnostics (); + check_append (); + UNIMPLEMENTED ("verify function closure utils"); } + + + /** verify the test input data + * @see TypeListManipl_test#check_diagnostics() + * for an explanation of the DISPLAY macro + */ + void + check_diagnostics () + { + DISPLAY (List1); + DISPLAY (List2); + ; + ASSERT (6 == (getNumberz<1,2,3> (Num<1>(), Num<2>(), Num<3>()))); + ASSERT (6 == (getNumberz<1,1,1> (Num<1>(), Num<1>(2), Num<1>(3)))); + } + + + void + check_append () + { + /////////////////////////////////////////////TODO + typedef Append,List2> Append7; + DISPLAY (Append7); + } }; diff --git a/tests/lib/meta/typelist-diagnostics.hpp b/tests/lib/meta/typelist-diagnostics.hpp index 63ccda325..c5bdd94a2 100644 --- a/tests/lib/meta/typelist-diagnostics.hpp +++ b/tests/lib/meta/typelist-diagnostics.hpp @@ -48,16 +48,27 @@ using boost::format; namespace lumiera { namespace typelist{ + /** dummy interface / baseclass for diagnostics */ + struct Numz + { + char o_; + Numz (char x =0) : o_(x) { } + }; + + /** constant-wrapper type for debugging purposes, * usable for generating lists of distinguishable types */ template - struct Num + struct Num : Numz { enum{ VAL=I }; + + Num (char x = char(I)) : Numz(x) { } }; + /* some forwards used by config-flags-test.cpp */ template struct Flag; template< char f1