diff --git a/research/try.cpp b/research/try.cpp
index 4eac80673..ff94160c6 100644
--- a/research/try.cpp
+++ b/research/try.cpp
@@ -1,23 +1,31 @@
/* try.cpp - to try out and experiment with new features....
* scons will create the binary bin/try
*/
+// 12/24 - investigate problem when perfect-forwarding into a binder
// 12/24 - investigate overload resolution on a templated function similar to std::get
// 11/24 - how to define a bare object location comparison predicate
// 11/23 - prototype for grouping from iterator
/** @file try.cpp
- * Find out about the conditions when an overload of a function template is picked.
- * This is an investigation regarding the proper way to overload `std::get`
- * especially when the base class of the custom type itself is a tuple.
+ * Partially binding / closing arguments of a function with _perfect forwarding_ can be problematic.
+ * The problem was encountered in the steam::engine::TypeHandler::create() - function with additional
+ * constructor arguments. Obviously, we want these to be _perfect forwarded_ into the actual constructor,
+ * but the binding must store a captured copy of these values, because the handler can be used repeatedly.
*
- * As it turns out, overload resolution works as expected; rather the implementation
- * of `std::get` causes the problems, as it triggers an assertion immediately when
- * instantiated with out-of-bounds parameters, which prevents the overload resolution
- * to commence and directly terminates the compilation. The reason is that this
- * standard implementation relies on std::tuple_element to do the actual
- * bounds checking. This can be demonstrated by extracting the standard
- * implementation and our custom implementation under a different name.
+ * The actual problem is caused by the instantiation of the target function, because the arguments are
+ * also passed into the binding mechanism by _perfect forwarding._ The target function template will thus
+ * be instantiated to expect RValues, but the binder can only pass a copy by-reference. At this point then
+ * the problem materialises (with a rather confusing error message).
+ *
+ * The Problem was already discussed on [Stackoverflow]
+ *
+ * A simple workaround is to change the types in the instantiation into references;
+ * obviously this can not work for some argument types; if a more elaborate handling is necessary,
+ * the [handling of bound arguments] should be considered in detail.
+ *
+ * [Stackoverflow]: https://stackoverflow.com/q/30968573/444796
+ * [handling of bound arguments]: http://en.cppreference.com/w/cpp/utility/functional/bind#Member_function_operator.28.29
*/
typedef unsigned int uint;
@@ -26,94 +34,52 @@ typedef unsigned int uint;
#include "lib/format-cout.hpp"
#include "lib/test/test-helper.hpp"
#include "lib/test/diagnostic-output.hpp"
-#include "lib/hetero-data.hpp"
#include "lib/util.hpp"
-#include
es gibt keinen einfachen und performanten Mechanismus, über den ich mir irgend ein Widget merken und später noch sicher addressieren kann, selbst wenn eine Diff-Nachricht inzwischen die Anzeige umbaut und das bezeichnete Element inzwischen gelöscht ist. Und zwar deshalb, weil wir hier von echten einfachen GTK-Widgets reden, und nicht von unseren "Tangibles", die am UI-Bus hängen. Selbst wenn wir noch gesicherte »Mediatoren« dazwischenschalten, also z.B. diese Nachrichten über jeweils ein zuständiges model::Tangible zustellen, dann haben wiederum diese das identische Problem: sie bekommen nicht garantiert mit, wenn eines der von ihnen verwalteten Widgets inzwischen nicht mehr existiert. Wir bräuchten
@@ -24827,9 +24825,7 @@
noch nicht klar, welche Rolle der spielt; ich sehe ihn erst mal vor, weil er möglich ist. Denkbar wäre, daß er durch User-Interaktion entsteht, oder aber auch systematisch generiert wird, um bestimmte Arten von Clips optisch abzusetzen
@@ -25537,9 +25533,7 @@
...aber die gesamte Verankerungs-Aktion läßt sich rein auf Widget-Interface-Ebene machen.
@@ -26300,9 +26294,7 @@
weil der Trigger irgendwo unten passiert, und nicht auf dem top-Level ViewHook
@@ -27450,9 +27442,7 @@
weil ich diese Benennungen von Anfang an auch so in FreeCAD verwendet habe, und jetzt nicht alles umbenennen möchte
@@ -29034,9 +29024,7 @@
d.h. wenn zufällig das Interface auch eine Methode CloneInto() enthält, aber mit einer unpassenden Signatur
@@ -29090,9 +29078,7 @@
nämlich immer dann, wenn man tatsächlich den CopySupport oder CloneSupport als Basis des Interfaces verwendet...
@@ -33199,9 +33185,7 @@
macht ggfs ganz natürlich einen box-shadow sichtbar
@@ -33277,9 +33261,7 @@
ClipPresenter::determineRequiredVerticalExtension()
@@ -35265,9 +35247,7 @@
weil dies die einzige Info ist,
@@ -36594,9 +36574,7 @@
das ist ein akzidentelles Problem
@@ -37335,9 +37313,7 @@
gehört diese nun dem Layout-Manager, oder gehört er der Geste?
@@ -37628,9 +37604,7 @@
das Platzieren auf den Canvas ist keine high-Performance-Operation;
+ Aufgerufen: (std::_Bind<void (*(std::_Placeholder<1>, int))(void*, int&&)>) (void*&)
+
+ Candidate: _Result std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args&& ...)
+
+ _Functor = void (*)(void*, int&&)
+
+ _Bound_args = {std::_Placeholder<1>, int}
+
+ Beobachtung: _Functor(_Bound_args ...)
+
+ also: func<ARGS& ...>
+
vielmehr ist es sogar vernachlässigbar im Vergleich zum Aufwand der Zeichen-Operationen; und letztere werden eben genau aus Performance-Gründen gebatcht und gebündelt....
@@ -82697,7 +82669,7 @@ Date: Thu Apr 20 18:53:17 2023 +0200
}
std::function<void(void*)>::function(std::_Bind<void (*(std::_Placeholder<1>, int))(void*, int&&)>&)
with CTOR = std::_Bind<void (*(std::_Placeholder<1>, int))(void*, int&&)>;
+
+
+
+
+
Für die BuffTable war früher jede Menge Funktionalität geplant, die inzwischen im BufferProvider realisiert wurde; der alte Test hängt seit >10 Jahren bei den Engine-Tests unimplementiert mit rum — es ist sinnlos, ihn nun umzuwidmen