From a530665769b36ab074e54dd8b705794fc1cf8830 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 21 Apr 2019 23:35:57 +0200 Subject: [PATCH] Library: fix some reference passing errors ...but bad news on the main issue: the workaround consumes the tuple and thus is not tenable! And what is even worse: the textbook implementation of std::apply is equivalent to our workaround and also consumes the argument tuple --- src/lib/verb-visitor.hpp | 2 +- tests/library/verb-visitor-dispatch-test.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/verb-visitor.hpp b/src/lib/verb-visitor.hpp index eeeb35a74..d556080ac 100644 --- a/src/lib/verb-visitor.hpp +++ b/src/lib/verb-visitor.hpp @@ -97,7 +97,7 @@ namespace lib { Verb verb_; Args args_; - Holder (typename Verb::Handler handlerRef, Literal verbID, ARGS... args) + Holder (typename Verb::Handler handlerRef, Literal verbID, ARGS&&... args) : verb_{handlerRef, verbID} , args_{std::forward (args)...} { } diff --git a/tests/library/verb-visitor-dispatch-test.cpp b/tests/library/verb-visitor-dispatch-test.cpp index c1fe99028..bfa493334 100644 --- a/tests/library/verb-visitor-dispatch-test.cpp +++ b/tests/library/verb-visitor-dispatch-test.cpp @@ -194,7 +194,7 @@ namespace test{ render_verbose (TokenSeq& tokens) { VerboseRenderer receiver; - for (Token tok : tokens) + for (Token& tok : tokens) cout << "dispatching " << tok << " -> '" << tok.applyTo(receiver) diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index ef157a971..24d838b2f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -19790,6 +19790,13 @@ + + + + + + +