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
This commit is contained in:
parent
e28635a11a
commit
a530665769
3 changed files with 9 additions and 2 deletions
|
|
@ -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> (args)...}
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -19790,6 +19790,13 @@
|
|||
<node CREATED="1555806866887" ID="ID_815971236" MODIFIED="1555806883289" TEXT="auch dann nicht: wenn die Funktion einen RValue verlangt??"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1555806884936" ID="ID_1433427722" MODIFIED="1555806896802" TEXT="per Experiment verifizieren">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node CREATED="1555895525635" ID="ID_1402481371" MODIFIED="1555895541157" TEXT="(verwende eine ctor-tracking-Klasse)"/>
|
||||
<node COLOR="#338800" CREATED="1555895463799" ID="ID_1147400949" MODIFIED="1555895487068" TEXT="Fehler entdeckt: ctor gibt Args per Value an das Tupel">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1555895488721" ID="ID_1447172232" MODIFIED="1555895516594" TEXT="JA! Es passiert eine move-Initialisierung">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue