From b6961e8f039f7d0dc0297b37f12437455095caa9 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 13 Jan 2018 00:58:08 +0100 Subject: [PATCH] DockAccess: better pass functor as const& into partial application seems to be the most orthogonal way to strip adornments from the SIG type Moreover, we want to move the functor into the closure, where it will be stored anyay. From there on, we can pass as const& into the binder (for creating the partially closed functor) --- src/gui/interact/view-spec-dsl.hpp | 6 +++--- src/lib/meta/function-closure.hpp | 4 ++-- wiki/thinkPad.ichthyo.mm | 18 +++++++++++------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/gui/interact/view-spec-dsl.hpp b/src/gui/interact/view-spec-dsl.hpp index 1e486cec1..63e18197c 100644 --- a/src/gui/interact/view-spec-dsl.hpp +++ b/src/gui/interact/view-spec-dsl.hpp @@ -177,7 +177,7 @@ namespace interact { { template static auto - buildPartialApplicator (FUN fun) + buildPartialApplicator (FUN&& fun) { using lib::meta::_Fun; using lib::meta::Split; @@ -202,13 +202,13 @@ namespace interact { return [=](auto&&... args) -> Allocator { ArgTuple params {forward (args)...}; - return PApply::bindBack (fun, params); + return PApply::bindBack (fun, params); }; } public: template - AllocSpec(FUN fun) + AllocSpec(FUN&& fun) : std::function (buildPartialApplicator (forward (fun))) { } }; diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp index 24d5ec433..564c77de2 100644 --- a/src/lib/meta/function-closure.hpp +++ b/src/lib/meta/function-closure.hpp @@ -620,7 +620,7 @@ namespace func{ * closed arguments; on invocation, only the remaining arguments need to be supplied. */ static LeftReducedFunc - bindFront (SIG& f, Tuple const& arg) + bindFront (SIG const& f, Tuple const& arg) { LeftReplacedArgs params {BuildL(arg)}; return func::Apply::template bind (f, params); @@ -635,7 +635,7 @@ namespace func{ * closed arguments; on invocation, only the remaining arguments need to be supplied. */ static RightReducedFunc - bindBack (SIG& f, Tuple const& arg) + bindBack (SIG const& f, Tuple const& arg) { RightReplacedArgs params {BuildR(arg)}; return func::Apply::template bind (f, params); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b7b029335..8ed87bf44 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -9098,8 +9098,7 @@ nämlich in lib::meta::func::PApply::bindBack

- - + @@ -9147,8 +9146,7 @@ };

- - +
@@ -9157,7 +9155,8 @@ - + + @@ -9170,8 +9169,7 @@ Vermutung: muß Lambda instantiieren...

- - +
@@ -9182,6 +9180,12 @@
+ + + + + +