From 90a5d76fc9f57e9775152ddfc42e2184a30106a2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 13 Jan 2018 00:20:01 +0100 Subject: [PATCH] DockAccess: solution how to bind partial application into generic lambda ...as it turned out, the result type was the problem: the lambda we provide typically does not yield an Allocator, but only its baseclass function solution: make Allocator a typedef, we don't expect any further functionality --- src/gui/interact/view-spec-dsl.hpp | 16 +++++----------- wiki/thinkPad.ichthyo.mm | 14 +++++++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/gui/interact/view-spec-dsl.hpp b/src/gui/interact/view-spec-dsl.hpp index 6428d9822..1e486cec1 100644 --- a/src/gui/interact/view-spec-dsl.hpp +++ b/src/gui/interact/view-spec-dsl.hpp @@ -157,11 +157,7 @@ namespace interact { * in creation or allocation of the view. The result of this invocation are the UI coordinates * of an existing or newly created view. */ - class Allocator - : public std::function - { - - }; + using Allocator = std::function; /** @@ -202,8 +198,8 @@ namespace interact { // 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) + + return [=](auto&&... args) -> Allocator { ArgTuple params {forward (args)...}; return PApply::bindBack (fun, params); @@ -213,10 +209,8 @@ namespace interact { public: template AllocSpec(FUN fun) -// : std::function (buildPartialApplicator (forward (fun))) - { - UNIMPLEMENTED ("generate an allocator builder functor by partial function application"); - } + : std::function (buildPartialApplicator (forward (fun))) + { } }; }}// namespace gui::interact diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 66ea4bde5..b7b029335 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -9157,10 +9157,10 @@ - + - + @@ -9172,11 +9172,15 @@ + + + + + + + - - -