From 612a4425500a3d6d0a8ccc11b3b7f52298e918e1 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 22 Apr 2019 17:45:38 +0200 Subject: [PATCH] Library: unable to reproduce the problem with an "equivalent" demo example ...the simplified demo variant in try.cpp is accepted by the compiler and works as intended, while the seemingly equivalent construction in verb-visitor.hpp is rejected by the compiler This discrepancy might lead to a solution....? --- research/try.cpp | 44 +++++++++++++++++++++++ wiki/thinkPad.ichthyo.mm | 76 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) diff --git a/research/try.cpp b/research/try.cpp index 02fbf7a0f..a2f2d93e2 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -123,6 +123,39 @@ applyTuple (FUN& fun) + ///////////////////////////TODO : Debugging + struct Trackr + { + size_t num; + + Trackr (size_t val) + : num(val) + { + cout <<"Trackr("< + + + + + + + + + +

+ d.h. std::get<idx> (std::forward<TUP> (tuple)) +

+ + +
+
+ + + + + + +

+ wenn ich das Tupel als Referenz anliefere +

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

+ ...sichtbar wenn man ein Trackr-Objekt +

+

+ als value-Parameter auf der Zielfunktion verwendet. +

+

+ +

+

+ Im extrahierten Beispiel wird das LValue-copy-initialisiert +

+

+ wohingegen im realen code, wo auch das std::forward(tuple) dabei ist, +

+

+ der betreffende Wert dann RValue-Initialisiert wird, d.h. dabei das betreffende Tupel-Element konsumiert +

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