Bugfix: rectify a moronic tuple type rebinding introduced with #988
At that time, our home-made Tuple type was replaced by std::tuple,
and then the command framework was extended to also allow command invocation
with arguments packaged as lib::diff::Record<GenNode>
With changeset 0e10ef09ec
A rebinding from std::tuple<ARGS...> to Types<ARGS> was introduced,
but unfortunately this was patched-in on top of the existing Types<ARGS...>
just as a partial specialisation.
Doing it this way is especially silly, since now this rebinding also kicks
in when std::tuple appears as regular payload type within Types<....>
This is what happened here: We have a Lambda taking a std::tuple<int, int>
as argument, yet when extracting the argument type, this rebinding kicks in
and transforms this argument into Types<int, int>
Oh well.
This commit is contained in:
parent
13d32916ee
commit
4d21baea6b
7 changed files with 68 additions and 8 deletions
|
|
@ -427,7 +427,7 @@ namespace lib {
|
|||
{
|
||||
using FunArgType = remove_reference_t<Arg>;
|
||||
static_assert (std::is_convertible<ARG, FunArgType>::value,
|
||||
"the expansion functor must accept the source iterator or state core as parameter");
|
||||
"the bound functor must accept the source iterator or state core as parameter");
|
||||
|
||||
static auto build() { return [](ARG& arg) -> ARG& { return arg; }; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -127,9 +127,15 @@ namespace meta {
|
|||
|
||||
|
||||
|
||||
/** match and rebind the type sequence from a tuple */
|
||||
/** temporary workaround: match and rebind the type sequence from a tuple */
|
||||
template<typename...TYPES>
|
||||
struct Types<std::tuple<TYPES...>>
|
||||
struct RebindTySeq
|
||||
{
|
||||
using Seq = typename Types<TYPES...>::Seq;
|
||||
using List = typename Seq::List;
|
||||
};
|
||||
template<typename...TYPES>
|
||||
struct RebindTySeq<std::tuple<TYPES...>>
|
||||
{
|
||||
using Seq = typename Types<TYPES...>::Seq;
|
||||
using List = typename Seq::List;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace control {
|
|||
using ArgumentBuff = InPlaceBuffer<ArgHolder>;
|
||||
|
||||
using ArgTuple = typename ArgHolder::ArgTuple;
|
||||
using Args = typename Types<ArgTuple>::Seq;
|
||||
using Args = typename lib::meta::RebindTySeq<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
||||
|
||||
|
||||
/* ====== in-place argument storage ====== */
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace control {
|
|||
using MementoBuff = InPlaceBuffer<MemHolder>;
|
||||
|
||||
using ArgTuple = typename ArgHolder::ArgTuple;
|
||||
using Args = typename Types<ArgTuple>::Seq;
|
||||
using Args = typename lib::meta::RebindTySeq<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
||||
|
||||
|
||||
/* ====== in-place storage buffers ====== */
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace test {
|
|||
string >
|
||||
showType ()
|
||||
{
|
||||
using TypeList = typename Types<TUP>::List;
|
||||
using TypeList = typename RebindTySeq<TUP>::List;
|
||||
using DumpPrinter = InstantiateChained<TypeList, Printer, NullP>;
|
||||
|
||||
return "TUPLE"
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ namespace test {
|
|||
typedef Types1::List L1; // starting from an existing Typelist...
|
||||
|
||||
typedef Tuple<L1> T_L1; // derive a tuple type from this typelist
|
||||
typedef Types<T_L1>::Seq Seq1; // extract the underlying type sequence
|
||||
|
||||
typedef RebindTySeq<T_L1>::Seq Seq1;
|
||||
// extract the underlying type sequence
|
||||
DISPLAY (T_L1);
|
||||
DISPLAY (Seq1);
|
||||
|
||||
|
|
|
|||
|
|
@ -6787,6 +6787,60 @@
|
|||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1510969031379" ID="ID_842384656" MODIFIED="1510969043561" TEXT="demonstrate_LayeredEvaluation();">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1512952846993" ID="ID_568101334" MODIFIED="1512955085252" TEXT="TupleHelper_test broken">
|
||||
<linktarget COLOR="#408281" DESTINATION="ID_568101334" ENDARROW="Default" ENDINCLINATION="299;-71;" ID="Arrow_ID_1210920107" SOURCE="ID_748691821" STARTARROW="None" STARTINCLINATION="-124;4;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1512952975600" ID="ID_1282921475" MODIFIED="1512952993489" TEXT="Types<tuple<TYPES...>>">
|
||||
<node CREATED="1512952994765" ID="ID_1028880050" MODIFIED="1512953023243" TEXT="wurde automatisch gehoben auf Types<TYPES...>">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
<node CREATED="1512953008628" ID="ID_105420180" MODIFIED="1512953018858" TEXT="ziemlich dumme Idee">
|
||||
<icon BUILTIN="smiley-neutral"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1512953639277" ID="ID_93632445" MODIFIED="1512953732408" TEXT="broken sind...">
|
||||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1512953663356" ID="ID_587022650" MODIFIED="1512953666295" TEXT="Tup1 :">
|
||||
<node CREATED="1512953639278" ID="ID_1100197404" MODIFIED="1512954771519" TEXT="TUPLE-<1>-<3>-<5>-">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1512953639278" ID="ID_894542190" MODIFIED="1512954775187" TEXT="TUPLE-<tuple<Num<1>, Num<3>, Num<5> >>-">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1512953674962" ID="ID_1880760198" MODIFIED="1512953677102" TEXT="T_L1 :">
|
||||
<node CREATED="1512953639278" ID="ID_1929044147" MODIFIED="1512954778777" TEXT="TUPLE-<1>-<3>-<5>-">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1512953639278" ID="ID_1790615976" MODIFIED="1512954785530" TEXT="TUPLE-<tuple<Num<1>, Num<3>, Num<5> >>-">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1512953684233" ID="ID_608070908" MODIFIED="1512953686341" TEXT="Seq1 :">
|
||||
<node CREATED="1512953639279" ID="ID_1741392154" MODIFIED="1512955031447" TEXT="-<1>-<3>-<5>-">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1512953639279" ID="ID_213667790" MODIFIED="1512955034003" TEXT="-<tuple<Num<1>, Num<3>, Num<5> >>-">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1512953692712" ID="ID_690443382" MODIFIED="1512953694636" TEXT="Prepend :">
|
||||
<node CREATED="1512953639279" ID="ID_1949823809" MODIFIED="1512954789660" TEXT="TUPLE-<i>-<1>-<3>-<5>-">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1512953639279" ID="ID_1268362964" MODIFIED="1512954792261" TEXT="TUPLE-<tuple<int, Num<1>, Num<3>, Num<5> >>-">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1512953030113" HGAP="21" ID="ID_227944051" MODIFIED="1512955073221" TEXT="bestehenden Code in Commands gefixt" VSHIFT="12">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1512953037928" ID="ID_1081876156" MODIFIED="1512953052337" TEXT="verwende nun explizite Rebinding-Metafunktion"/>
|
||||
<node CREATED="1512955051435" ID="ID_1397072837" MODIFIED="1512955062645" TEXT="weitere Fehler im Test-Diagnose-Code">
|
||||
<icon BUILTIN="ksmiletris"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue