diff --git a/src/gui/interact/view-spec-dsl.hpp b/src/gui/interact/view-spec-dsl.hpp index 2734f6280..6428d9822 100644 --- a/src/gui/interact/view-spec-dsl.hpp +++ b/src/gui/interact/view-spec-dsl.hpp @@ -99,6 +99,9 @@ #include "lib/error.hpp" #include "lib/symbol.hpp" +#include "lib/meta/function.hpp" +#include "lib/meta/tuple-helper.hpp" +#include "lib/meta/function-closure.hpp" #include "gui/interact/ui-coord.hpp" //#include @@ -113,6 +116,7 @@ namespace interact { // using std::unique_ptr; // using std::string; + using std::forward; // class GlobalCtx; @@ -171,13 +175,45 @@ namespace interact { * - its second argument serves for parametrisation or specialisation of the strategy; it will * be "baked" into the generated allocator. */ - template + template class AllocSpec - : public std::function + : public std::function { + template + static auto + buildPartialApplicator (FUN fun) + { + using lib::meta::_Fun; + using lib::meta::Split; + using lib::meta::Tuple; + using lib::meta::func::_Sig; + using lib::meta::func::PApply; + + typedef typename _Fun::Ret Ret; + typedef typename _Fun::Args Args; + typedef typename Split::Head Arg1; + typedef typename Split::Tail FurtherArgs; +// typedef typename _Sig::Type Signature; +// typedef std::function Function; + + typedef Tuple ArgTuple; +// typedef typename _PapE::Arg ArgType; +// typedef Types ArgTypeSeq; +// typedef Tuple ArgTuple; +// ArgTuple val(arg); +// return PApply::bindBack (f, val); + /////////////////////////////////////////////////TODO looks like we need to *instantiate* the generic lambda before being able to bind it into a function + return [=](auto&&... args) + { + ArgTuple params {forward (args)...}; + return PApply::bindBack (fun, params); + }; + } + public: template AllocSpec(FUN fun) +// : std::function (buildPartialApplicator (forward (fun))) { UNIMPLEMENTED ("generate an allocator builder functor by partial function application"); } diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp index 1ab1debeb..24d5ec433 100644 --- a/src/lib/meta/function-closure.hpp +++ b/src/lib/meta/function-closure.hpp @@ -545,7 +545,7 @@ namespace func{ * @tparam VAL type sequence describing the tuple of values * used for closing arguments * @note the construction of this helper template does not verify or - * match types to to the signature. In case of mismatch, you'll get + * match types to the signature. In case of mismatch, you'll get * a compilation failure from `std::bind` (which can be confusing) */ template diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 3950e8825..66ea4bde5 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -4343,8 +4343,7 @@ und totale Coverage nur nachträglich durch Längenvergleich festzustellen

- - + @@ -8420,8 +8419,7 @@ ist keine Lösung

- - + @@ -8440,8 +8438,7 @@ ist partielle Lösung

- - + @@ -8463,8 +8460,7 @@ Ergebnis-Ausgabe ist die jeweilige mögliche Coverage

- - + @@ -8527,8 +8523,7 @@ aber zählt erst mal für sich nicht als Lösung

- - +
@@ -8582,8 +8577,7 @@ am Ende des Patterns liegen

- - + @@ -8694,8 +8688,7 @@ YAGNI

- - + @@ -8728,8 +8721,7 @@ - - + @@ -8765,8 +8757,7 @@ Denn für letzteren gibt es die "canXX"-Prädikate

- - +
@@ -8929,8 +8920,7 @@ Also sollte das auf dem API der default sein

- - +
@@ -9085,6 +9075,111 @@ + + + + + + + + + + + + + + + + + + + +

+ nämlich in lib::meta::func::PApply::bindBack +

+ + +
+
+ + + + + + +
+ + + + + + + + + + + + + + +

+ // generic lambda, operator() is a template with one parameter +

+

+ auto vglambda = [](auto printer) { +

+

+     return [=](auto&&... ts) // generic lambda, ts is a parameter pack +

+

+     { +

+

+         printer(std::forward<decltype(ts)>(ts)...); +

+

+         return [=] { printer(ts...); }; // nullary lambda (takes no parameters) +

+

+     }; +

+

+ }; +

+ + +
+ +
+ + + + + + + + + + + + + + + +

+ Vermutung: muß Lambda instantiieren... +

+ + +
+ +
+ + + + + +
@@ -9388,8 +9483,7 @@ das ist immer schon korrekt erledigt

- - + @@ -9797,8 +9891,7 @@ thin autmentation layer

- - +