clean-up: validate use of variadic seq with tuples and generators

Most of the type-list and type-sequence related eccosystem can be
just switched over, after having added the conversion variants for
the new-style variadic type sequences

Again this was used as opportunity to improve readability of related tests
This commit is contained in:
Fischlurch 2025-06-03 16:14:13 +02:00
parent 47b57da646
commit 412abbace2
9 changed files with 141 additions and 140 deletions

View file

@ -94,22 +94,22 @@ namespace meta {
template<> template<>
struct BuildIndexSeq<0> struct BuildIndexSeq<0>
{ {
using Empty = IndexSeq<>; using EmptySeq = IndexSeq<>;
using Ascending = Empty; using Ascending = EmptySeq;
using Descending = Empty; using Descending = EmptySeq;
template<size_t> template<size_t>
using OffsetBy = Empty; using OffsetBy = EmptySeq;
template<size_t> template<size_t>
using FilledWith = Empty; using FilledWith = EmptySeq;
template<size_t> template<size_t>
using First = Empty; using First = EmptySeq;
template<size_t> template<size_t>
using After = Empty; using After = EmptySeq;
}; };
@ -140,6 +140,7 @@ namespace meta {
}; };
/** build an index number sequence from a type sequence */ /** build an index number sequence from a type sequence */
//////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #987 temporary WORKAROUND -- to be obsoleted
template<typename...TYPES> template<typename...TYPES>
struct BuildIdxIter<TyOLD<TYPES...>> struct BuildIdxIter<TyOLD<TYPES...>>
{ {
@ -162,6 +163,11 @@ namespace meta {
template<size_t c> template<size_t c>
using After = typename Builder::template After<c>; using After = typename Builder::template After<c>;
}; };
//////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #987 temporary WORKAROUND(END)
template<typename...TYPES>
struct BuildIdxIter<TySeq<TYPES...>>
: BuildIdxIter<TYPES...>
{ };

View file

@ -277,7 +277,7 @@ namespace interact {
// append ID of the new element to be created // append ID of the new element to be created
// unless it's already there (and thus exists) // unless it's already there (and thus exists)
resolver.append (elementTypeID); resolver.append (elementTypeID);
return move (resolver); //////////////////////////////////////////////////////////////////TICKET #1402 : need a better solution for the builder-terminal-op. (it collides with the templated UICoord ctor) return move (resolver); //////////////////////////////////////////////////////////////////TICKET #1402 : need a better solution for the builder-terminal-op. (it collides with the templated UICoord ctor) |NOTE: the compiler waring is wrong here, the move() is essential
// use the first suitable solution and exit // use the first suitable solution and exit
} }
else else

View file

@ -374,36 +374,7 @@ return: 0
END END
TEST "type sequence manipulation" TypeSeqManipl_test <<END TEST "type sequence manipulation" TypeSeqManip_test <<END
out: LL :-<1>-<2>-<3>-<7>-<8>-<9>-
out: Seq :-<1>-<2>-<3>-<7>-<8>-<9>-
out: SeqList :-<1>-<2>-<3>-<7>-<8>-<9>-
out: NulS :-
out: Prepend1 :-<5>-<1>-<2>-<3>-
out: Prepend2 :-<·>-<1>-<2>-<3>-
out: Prepend3 :-<5>-
out: Prepend4 :-
out: Seq_0 :-<7>-<8>-<9>-<1>-<2>-<3>-
out: Seq_1 :-<8>-<9>-<1>-<2>-<3>-
out: Seq_2 :-<9>-<1>-<2>-<3>-
out: Seq_3 :-<1>-<2>-<3>-
out: Seq_4 :-<2>-<3>-
out: Seq_5 :-<3>-
out: Seq_6 :-
out: Head_0 :-<7>-
out: Head_1 :-<8>-
out: Head_2 :-<9>-
out: Head_3 :-<1>-
out: Head_4 :-<2>-
out: Head_5 :-<3>-
out: Head_6 :-
out: Seq :-<1>-<2>-<3>-<7>-<8>-<9>-
out: List :-<1>-<2>-<3>-<7>-<8>-<9>-
out: First :-<1>-
out: Tail :-<2>-<3>-<7>-<8>-<9>-
out: Prefix :-<1>-<2>-<3>-<7>-<8>-
out: Last :-<9>-
out: HeadEnd :-<1>-<9>-
return: 0 return: 0
END END
@ -420,11 +391,6 @@ out-lit: L3 :-<7>-
out-lit: Tup1 :TUPLE-<1>-<3>-<5>- out-lit: Tup1 :TUPLE-<1>-<3>-<5>-
out-lit: Tup1() :«tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5)) out-lit: Tup1() :«tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5))
out-lit: tup1x :«tuple<Num<1>, Num<3>, Num<5> >»──({11},(3),{55}) out-lit: tup1x :«tuple<Num<1>, Num<3>, Num<5> >»──({11},(3),{55})
out-lit: T_L1 :TUPLE-<1>-<3>-<5>-
out-lit: Seq1 :-<1>-<3>-<5>-
out-lit: tup1 :«tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5))
out-lit: Prepend :TUPLE-<i>-<1>-<3>-<5>-
out-lit: prep :«tuple<int, Num<1>, Num<3>, Num<5> >»──(22,{11},{33},(5))
out-lit: «tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5)) out-lit: «tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5))
out-lit: «tuple<int, Num<1>, Num<3>, Num<5> >»──(22,{11},{33},(5)) out-lit: «tuple<int, Num<1>, Num<3>, Num<5> >»──(22,{11},{33},(5))
out-lit: «tuple<>»──() out-lit: «tuple<>»──()

View file

@ -35,11 +35,11 @@ namespace test {
namespace { // test cases and data.... namespace { // test cases and data....
typedef TyOLD< Num<1> typedef TySeq< Num<1>
, Num<3> , Num<3>
, Num<5> , Num<5>
> Types1; > Types1;
typedef TyOLD< Num<2> typedef TySeq< Num<2>
, Num<4> , Num<4>
, Num<6> , Num<6>
> Types2; > Types2;
@ -95,7 +95,7 @@ namespace test {
class GeneratorCombinations_test : public Test class GeneratorCombinations_test : public Test
{ {
virtual void virtual void
run (Arg) run (Arg)
{ {
checkCartesian(); checkCartesian();
checkCaseInstantiation(); checkCaseInstantiation();
@ -113,9 +113,9 @@ namespace test {
void void
checkCaseInstantiation () checkCaseInstantiation ()
{ {
typedef InstantiateChainedCombinations< Types1,Types2 using CombnationCases = InstantiateChainedCombinations< Types1,Types2
, TestCase , TestCase
, IterationEnd > CombnationCases; , IterationEnd >;
cout << "All-Test-Combinations-" << CombnationCases::visitAll() << endl; cout << "All-Test-Combinations-" << CombnationCases::visitAll() << endl;
} }

View file

@ -29,10 +29,11 @@
#include "meta/tuple-diagnostics.hpp" #include "meta/tuple-diagnostics.hpp"
#include "lib/format-cout.hpp" #include "lib/format-cout.hpp"
#include <string>
using ::test::Test;
using lib::test::showSizeof; using lib::test::showSizeof;
using util::toString;
using std::get;
namespace lib { namespace lib {
namespace meta { namespace meta {
@ -43,14 +44,14 @@ namespace test {
namespace { // test data namespace { // test data
typedef TyOLD< Num<1> typedef TySeq< Num<1>
, Num<3> , Num<3>
, Num<5> , Num<5>
> Types1; > Types1;
typedef TyOLD< Num<2> typedef TySeq< Num<2>
, Num<4> , Num<4>
> Types2; > Types2;
typedef TyOLD< Num<7>> Types3; typedef TySeq< Num<7>> Types3;
@ -97,6 +98,11 @@ namespace test {
DISPLAY (Tup1); // prints the type DISPLAY (Tup1); // prints the type
DUMPVAL (Tup1()); // prints the contents DUMPVAL (Tup1()); // prints the contents
DUMPVAL (tup1x); DUMPVAL (tup1x);
EXPECT (Types1, "-<1>-<3>-<5>-");
EXPECT (Tup1, "TUPLE-<1>-<3>-<5>-");
CHECK (get<2>(tup1x) == Num<5>{55});
CHECK (toString(tup1x) == "«tuple<Num<1>, Num<3>, Num<5> >»──({11},(3),{55})"_expect);
} }
@ -113,23 +119,27 @@ namespace test {
using T_L1 = Tuple<L1>; // derive a tuple type from this typelist using T_L1 = Tuple<L1>; // derive a tuple type from this typelist
using Seq1 = RebindTupleTypes<T_L1>::Seq; using Seq1 = RebindTupleTypes<T_L1>::Seq;
// extract the underlying type sequence // extract the underlying type sequence
DISPLAY (T_L1); EXPECT (T_L1, "TUPLE-<1>-<3>-<5>-");
DISPLAY (Seq1); EXPECT (Seq1, "-<1>-<3>-<5>-");
T_L1 tup1; // can be instantiated at runtime (and is just a std:tuple) T_L1 tup1; // can be instantiated at runtime (and is just a std:tuple)
DUMPVAL (tup1); CHECK (toString(tup1) == "«tuple<Num<1>, Num<3>, Num<5> >»──((1),(3),(5))"_expect);
using Prepend = Tuple<Node<int, L1>>; using Prepend = Tuple<Node<int, L1>>;
DISPLAY (Prepend); // another ListType based tuple created by prepending // another ListType based tuple created by prepending
EXPECT (Prepend, "TUPLE-<i>-<1>-<3>-<5>-");
Prepend prep (22, 11,33,Num<5>()); Prepend prep (22, 11,33,Num<5>());
DUMPVAL (prep); CHECK (toString(prep) == "«tuple<int, Num<1>, Num<3>, Num<5> >»──(22,{11},{33},(5))"_expect);
using NulT = Tuple<TyOLD<> >; // plain-flat empty Tuple using NulT = Tuple<TySeq<> >; // plain-flat empty Tuple
using NulL = Tuple<Nil>; // list-style empty Tuple using NulL = Tuple<Nil>; // list-style empty Tuple
NulT nulT; // and these, too, can be instantiated NulT nulT; // and these, too, can be instantiated
NulL nulL; NulL nulL;
CHECK (toString(nulT) == "«tuple<>»──()"_expect);
CHECK (toString(nulL) == "«tuple<>»──()"_expect);
CHECK ((is_same<NulT, NulL>()));
using S4 = struct{int a,b,c,d;}; // expect this to have the same memory layout using S4 = struct{int a,b,c,d;}; // expect this to have the same memory layout
CHECK (sizeof(S4) == sizeof(prep)); CHECK (sizeof(S4) == sizeof(prep));
@ -149,6 +159,8 @@ namespace test {
<< showSizeof(prep) <<endl << showSizeof(prep) <<endl
<< showSizeof(nulT) <<endl << showSizeof(nulT) <<endl
<< showSizeof(nulL) <<endl; << showSizeof(nulL) <<endl;
CHECK (sizeof(prep) == sizeof(int)+sizeof(Num<1>)+sizeof(Num<3>)+sizeof(Num<5>));
} }
}; };

View file

@ -31,7 +31,7 @@ using lib::idi::EntryID;
using lib::diff::Rec; using lib::diff::Rec;
using lib::diff::MakeRec; using lib::diff::MakeRec;
using lib::diff::GenNode; using lib::diff::GenNode;
using lib::meta::TyOLD; using lib::meta::TySeq;
using lib::meta::Tuple; using lib::meta::Tuple;
using lib::meta::buildTuple; using lib::meta::buildTuple;
using lib::time::Duration; using lib::time::Duration;
@ -82,8 +82,8 @@ namespace test {
void void
show_simpleUsage() show_simpleUsage()
{ {
using NiceTypes = TyOLD<string, int>; using NiceTypes = TySeq<string, int>;
using UgglyTypes = TyOLD<EntryID<long>, Symbol, int, int64_t, double, Duration>; // various conversions and an immutable type (Duration) using UgglyTypes = TySeq<EntryID<long>, Symbol, int, int64_t, double, Duration>; // various conversions and an immutable type (Duration)
Rec args = MakeRec().scope("lalü", 42); Rec args = MakeRec().scope("lalü", 42);
Rec urgs = MakeRec().scope("lalü", "lala", 12, 34, 5.6, Time(7,8,9)); Rec urgs = MakeRec().scope("lalü", "lala", 12, 34, 5.6, Time(7,8,9));
@ -91,8 +91,15 @@ namespace test {
cout << args <<endl; cout << args <<endl;
cout << urgs <<endl; cout << urgs <<endl;
cout << buildTuple<NiceTypes> (args) <<endl; auto argT = buildTuple<NiceTypes> (args);
cout << buildTuple<UgglyTypes> (urgs) <<endl; auto urgT = buildTuple<UgglyTypes> (urgs);
cout << argT <<endl;
cout << urgT <<endl;
CHECK (get<0>(argT) == "lalü"_expect);
CHECK (get<0>(urgT) == "ID<long>-lal"_expect);
CHECK (get<1>(urgT) == "lala"_expect);
} }
@ -101,19 +108,19 @@ namespace test {
{ {
Rec args = MakeRec().scope("surprise", 42); Rec args = MakeRec().scope("surprise", 42);
using TooMany = TyOLD<string, int, long>; using TooMany = TySeq<string, int, long>;
VERIFY_ERROR (WRONG_TYPE, buildTuple<TooMany> (args)); // number of types in tuple exceeds capacity of the supplied argument record VERIFY_ERROR (WRONG_TYPE, buildTuple<TooMany> (args)); // number of types in tuple exceeds capacity of the supplied argument record
using Unsigned = TyOLD<string, uint>; using Unsigned = TySeq<string, uint>;
using Floating = TyOLD<string, float>; using Floating = TySeq<string, float>;
using Narrowing = TyOLD<string, short>; using Narrowing = TySeq<string, short>;
VERIFY_ERROR (WRONG_TYPE, buildTuple<Unsigned> (args)); // dangerous conversion from signed to unsigned int is prohibited VERIFY_ERROR (WRONG_TYPE, buildTuple<Unsigned> (args)); // dangerous conversion from signed to unsigned int is prohibited
VERIFY_ERROR (WRONG_TYPE, buildTuple<Floating> (args)); // conversion from integral to floating point element is prohibited VERIFY_ERROR (WRONG_TYPE, buildTuple<Floating> (args)); // conversion from integral to floating point element is prohibited
VERIFY_ERROR (WRONG_TYPE, buildTuple<Narrowing> (args)); // narrowing conversion from int to short is prohibited VERIFY_ERROR (WRONG_TYPE, buildTuple<Narrowing> (args)); // narrowing conversion from int to short is prohibited
// yet other (non-numeric) conversions are still possible // yet other (non-numeric) conversions are still possible
Rec timeArg = MakeRec().scope(Time(1,2,3,4)); Rec timeArg = MakeRec().scope(Time(1,2,3,4));
using TupStr = TyOLD<string>; using TupStr = TySeq<string>;
Tuple<TupStr> tup = buildTuple<TupStr> (timeArg); Tuple<TupStr> tup = buildTuple<TupStr> (timeArg);
CHECK (std::get<string> (tup) == "4:03:02.001"); CHECK (std::get<string> (tup) == "4:03:02.001");
@ -126,24 +133,24 @@ namespace test {
VERIFY_ERROR (WRONG_TYPE, buildTuple<Floating> (args)); VERIFY_ERROR (WRONG_TYPE, buildTuple<Floating> (args));
VERIFY_ERROR (WRONG_TYPE, buildTuple<Narrowing> (args)); VERIFY_ERROR (WRONG_TYPE, buildTuple<Narrowing> (args));
using ToSizeT = TyOLD<string, size_t>; using ToSizeT = TySeq<string, size_t>;
VERIFY_ERROR (WRONG_TYPE, (buildTuple<ToSizeT> (args))); // not even conversion to size_t is allowed VERIFY_ERROR (WRONG_TYPE, (buildTuple<ToSizeT> (args))); // not even conversion to size_t is allowed
struct Dummy struct Hashy
{ {
HashVal hash; HashVal hash;
Dummy (LuidH const& luid) Hashy (LuidH const& luid)
: hash(luid) : hash(luid)
{ } { }
}; };
using WithDummy = TyOLD<string, Dummy>; using WithHashy = TySeq<string, Hashy>;
Tuple<WithDummy> tup2 = buildTuple<WithDummy> (hashArg); // while any type explicitly constructible from LUID are permitted. Tuple<WithHashy> tup2 = buildTuple<WithHashy> (hashArg); // while any type explicitly constructible from LUID are permitted.
VERIFY_ERROR (WRONG_TYPE, buildTuple<WithDummy> (args)); // building a Dummy from int(42) is disallowed, of course VERIFY_ERROR (WRONG_TYPE, buildTuple<WithHashy> (args)); // building a `Hashy` from int(42) is disallowed, of course
HashVal h = get<Dummy>(tup2).hash; HashVal h = get<Hashy>(tup2).hash;
CHECK (h == hashArg.child(1).data.get<LuidH>()); // note: the narrowing conversion happens within LuidH::operator HashVal() CHECK (h == hashArg.child(1).data.get<LuidH>()); // note: the narrowing conversion happens within LuidH::operator HashVal()
} }
}; };

View file

@ -33,7 +33,6 @@
#include "lib/meta/generator.hpp" #include "lib/meta/generator.hpp"
#include "lib/meta/typelist-manip.hpp" #include "lib/meta/typelist-manip.hpp"
#include "meta/typelist-diagnostics.hpp" #include "meta/typelist-diagnostics.hpp"
#include "lib/test/diagnostic-output.hpp"/////////////////TODO
#include <type_traits> #include <type_traits>
@ -383,6 +382,7 @@ namespace test {
/** @test demonstrate special setup to enumerate case combinations /** @test demonstrate special setup to enumerate case combinations
* @remark can be used to pre-generate template instantiations * @remark can be used to pre-generate template instantiations
* at compile time, for a complete configuration space * at compile time, for a complete configuration space
* @see GeneratorCombinations_test
*/ */
void void
verify_combine() verify_combine()

View file

@ -14,7 +14,7 @@
/** @file typeseq-manip-test.cpp /** @file typeseq-manip-test.cpp
** verify the proper working of simple type sequence manipulations. ** verify the proper working of simple type sequence manipulations.
** Here, "type sequence" denotes an instance of the template Types<T1,T2,...> from ** Here, "type sequence" stands for an instance of the template Types<T1,T2,...> from
** typelist.hpp . While this template is the entry point to type list metaprogramming, ** typelist.hpp . While this template is the entry point to type list metaprogramming,
** in many cases it is useful on its own for specifying a fixed collection of types, e.g. ** in many cases it is useful on its own for specifying a fixed collection of types, e.g.
** for building a tuple type. Thus, while more complicated manipulations typically rely ** for building a tuple type. Thus, while more complicated manipulations typically rely
@ -32,7 +32,6 @@
#include "lib/meta/typeseq-util.hpp" #include "lib/meta/typeseq-util.hpp"
#include "lib/meta/typelist-manip.hpp" #include "lib/meta/typelist-manip.hpp"
#include "meta/typelist-diagnostics.hpp" #include "meta/typelist-diagnostics.hpp"
#include "lib/format-cout.hpp"
using std::string; using std::string;
@ -42,19 +41,17 @@ namespace meta {
namespace test { namespace test {
namespace { // test data namespace { // type-sequences to test with
typedef TyOLD< Num<1> typedef TySeq< Num<1>
, Num<2> , Num<2>
, Num<3> , Num<3>
> Types1; > Types1;
typedef TyOLD< Num<7> typedef TySeq< Num<7>
, Num<8> , Num<8>
, Num<9> , Num<9>
> Types2; > Types2;
// see also the CountDown template in typelist-diagnostics.hpp...
} // (End) test data } // (End) test data
@ -69,10 +66,10 @@ namespace test {
* - create shifted sequences * - create shifted sequences
* - dissect a sequence to extract head, tail, prefix, last element * - dissect a sequence to extract head, tail, prefix, last element
*/ */
class TypeSeqManipl_test : public Test class TypeSeqManip_test : public Test
{ {
virtual void virtual void
run (Arg) run (Arg)
{ {
check_indexOf (); check_indexOf ();
check_buildSeq(); check_buildSeq();
@ -97,32 +94,25 @@ namespace test {
check_buildSeq () check_buildSeq ()
{ {
using LL = Append<Types1::List, Types2::List>::List; using LL = Append<Types1::List, Types2::List>::List;
DISPLAY (LL); EXPECT (LL, "-<1>-<2>-<3>-<7>-<8>-<9>-");
using Seq = TyOLD<LL>::Seq; using Seq = TySeq<LL>::Seq;
using SeqList = Seq::List; using SeqList = Seq::List;
DISPLAY (Seq); EXPECT (Seq, "-<1>-<2>-<3>-<7>-<8>-<9>-");
DISPLAY (SeqList); EXPECT (SeqList, "-<1>-<2>-<3>-<7>-<8>-<9>-");
using NulS = TyOLD<NilNode>::Seq; using NulS = TySeq<NilNode>::Seq;
DISPLAY (NulS); EXPECT (NulS, "-");
} }
void void
check_prepend () check_prepend ()
{ {
using Prepend1 = Prepend<Num<5>, Types1 >; using Prepend1 = Prepend<Num<5>, Types1 >; EXPECT (Prepend1, "-<5>-<1>-<2>-<3>-");
DISPLAY(Prepend1); using Prepend2 = Prepend<Nil, Types1 >; EXPECT (Prepend2, "-<·>-<1>-<2>-<3>-");
using Prepend3 = Prepend<Num<5>, TySeq<>>; EXPECT (Prepend3, "-<5>-");
using Prepend2 = Prepend<Nil, Types1 >; using Prepend4 = Prepend<Nil, TySeq<>>; EXPECT (Prepend4, "-");
DISPLAY(Prepend2);
using Prepend3 = Prepend<Num<5>, TyOLD<>>;
DISPLAY(Prepend3);
using Prepend4 = Prepend<Nil, TyOLD<>>;
DISPLAY(Prepend4);
} }
@ -130,23 +120,23 @@ namespace test {
check_shift () check_shift ()
{ {
using LL = Append<Types2::List, Types1::List>::List; using LL = Append<Types2::List, Types1::List>::List;
using Seq = TyOLD<LL>::Seq; using Seq = TySeq<LL>::Seq;
using Seq_0 = Shifted<Seq,0>::Type; DISPLAY (Seq_0); using Seq_0 = Shifted<Seq,0>::Type; EXPECT (Seq_0, "-<7>-<8>-<9>-<1>-<2>-<3>-");
using Seq_1 = Shifted<Seq,1>::Type; DISPLAY (Seq_1); using Seq_1 = Shifted<Seq,1>::Type; EXPECT (Seq_1, "-<8>-<9>-<1>-<2>-<3>-");
using Seq_2 = Shifted<Seq,2>::Type; DISPLAY (Seq_2); using Seq_2 = Shifted<Seq,2>::Type; EXPECT (Seq_2, "-<9>-<1>-<2>-<3>-");
using Seq_3 = Shifted<Seq,3>::Type; DISPLAY (Seq_3); using Seq_3 = Shifted<Seq,3>::Type; EXPECT (Seq_3, "-<1>-<2>-<3>-");
using Seq_4 = Shifted<Seq,4>::Type; DISPLAY (Seq_4); using Seq_4 = Shifted<Seq,4>::Type; EXPECT (Seq_4, "-<2>-<3>-");
using Seq_5 = Shifted<Seq,5>::Type; DISPLAY (Seq_5); using Seq_5 = Shifted<Seq,5>::Type; EXPECT (Seq_5, "-<3>-");
using Seq_6 = Shifted<Seq,6>::Type; DISPLAY (Seq_6); using Seq_6 = Shifted<Seq,6>::Type; EXPECT (Seq_6, "-");
using Head_0 = TyOLD<Shifted<Seq,0>::Head>; DISPLAY (Head_0); using Head_0 = TySeq<Shifted<Seq,0>::Head>; EXPECT (Head_0, "-<7>-");
using Head_1 = TyOLD<Shifted<Seq,1>::Head>; DISPLAY (Head_1); using Head_1 = TySeq<Shifted<Seq,1>::Head>; EXPECT (Head_1, "-<8>-");
using Head_2 = TyOLD<Shifted<Seq,2>::Head>; DISPLAY (Head_2); using Head_2 = TySeq<Shifted<Seq,2>::Head>; EXPECT (Head_2, "-<9>-");
using Head_3 = TyOLD<Shifted<Seq,3>::Head>; DISPLAY (Head_3); using Head_3 = TySeq<Shifted<Seq,3>::Head>; EXPECT (Head_3, "-<1>-");
using Head_4 = TyOLD<Shifted<Seq,4>::Head>; DISPLAY (Head_4); using Head_4 = TySeq<Shifted<Seq,4>::Head>; EXPECT (Head_4, "-<2>-");
using Head_5 = TyOLD<Shifted<Seq,5>::Head>; DISPLAY (Head_5); using Head_5 = TySeq<Shifted<Seq,5>::Head>; EXPECT (Head_5, "-<3>-");
using Head_6 = TyOLD<Shifted<Seq,6>::Head>; DISPLAY (Head_6); using Head_6 = TySeq<Shifted<Seq,6>::Head>; EXPECT (Head_6, "-");
} }
@ -154,19 +144,18 @@ namespace test {
check_split () check_split ()
{ {
using LL = Append<Types1::List, Types2::List>::List; using LL = Append<Types1::List, Types2::List>::List;
using Seq = TyOLD<LL>::Seq; using Seq = TySeq<LL>::Seq; EXPECT (Seq , "-<1>-<2>-<3>-<7>-<8>-<9>-");
DISPLAY (Seq);
using List = Split<Seq>::List; DISPLAY(List); using List = Split<Seq>::List; EXPECT (List , "-<1>-<2>-<3>-<7>-<8>-<9>-");
using First = Split<Seq>::First; DISPLAY(First); using First = Split<Seq>::First; EXPECT (First , "-<1>-" );
using Tail = Split<Seq>::Tail; DISPLAY(Tail); using Tail = Split<Seq>::Tail; EXPECT (Tail , "-<2>-<3>-<7>-<8>-<9>-" );
using Prefix = Split<Seq>::Prefix; DISPLAY(Prefix); using Prefix = Split<Seq>::Prefix; EXPECT (Prefix, "-<1>-<2>-<3>-<7>-<8>-" );
using Last = Split<Seq>::Last; DISPLAY(Last); using Last = Split<Seq>::Last; EXPECT (Last , "-<9>-" );
using Head = Split<Seq>::Head; using Head = Split<Seq>::Head;
using End = Split<Seq>::End; using End = Split<Seq>::End;
using HeadEnd = TyOLD<Head,End>; DISPLAY(HeadEnd); using HeadEnd = TySeq<Head,End>; EXPECT (HeadEnd, "-<1>-<9>-");
} }
@ -174,7 +163,7 @@ namespace test {
/** Register this test class... */ /** Register this test class... */
LAUNCHER (TypeSeqManipl_test, "unit common"); LAUNCHER (TypeSeqManip_test, "unit common");

View file

@ -164294,8 +164294,11 @@ Since then others have made contributions, see the log for the history.</font></
</richcontent> </richcontent>
</node> </node>
<node CREATED="1748828781783" ID="ID_691444823" MODIFIED="1748828794388" TEXT="sollte also f&#xfc;r alle Varianten gleicherma&#xdf;en greifen"/> <node CREATED="1748828781783" ID="ID_691444823" MODIFIED="1748828794388" TEXT="sollte also f&#xfc;r alle Varianten gleicherma&#xdf;en greifen"/>
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1748888164617" ID="ID_145174722" MODIFIED="1748888298322" TEXT="sollte Tests ustellen auf Inline-Checks (mit _expect)"> <node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1748888164617" ID="ID_145174722" MODIFIED="1748980951490" TEXT="sollte Tests ustellen auf Inline-Checks (mit _expect)">
<arrowlink DESTINATION="ID_1431343903" ENDARROW="Default" ENDINCLINATION="156;-14;" ID="Arrow_ID_1374886089" STARTARROW="None" STARTINCLINATION="253;316;"/> <arrowlink DESTINATION="ID_1431343903" ENDARROW="Default" ENDINCLINATION="206;-13;" ID="Arrow_ID_1374886089" STARTARROW="None" STARTINCLINATION="250;329;"/>
<arrowlink DESTINATION="ID_665924488" ENDARROW="Default" ENDINCLINATION="358;-61;" ID="Arrow_ID_369345367" STARTARROW="None" STARTINCLINATION="208;250;"/>
<arrowlink DESTINATION="ID_653647632" ENDARROW="Default" ENDINCLINATION="135;-20;" ID="Arrow_ID_1807168701" STARTARROW="None" STARTINCLINATION="235;315;"/>
<arrowlink DESTINATION="ID_717954051" ENDARROW="Default" ENDINCLINATION="96;-9;" ID="Arrow_ID_1349909689" STARTARROW="None" STARTINCLINATION="264;361;"/>
<icon BUILTIN="yes"/> <icon BUILTIN="yes"/>
<node CREATED="1748888193247" ID="ID_979097077" MODIFIED="1748888251981" TEXT="in der bisherigen Form sind sie ordentlich &#x2014; aber wertlos"> <node CREATED="1748888193247" ID="ID_979097077" MODIFIED="1748888251981" TEXT="in der bisherigen Form sind sie ordentlich &#x2014; aber wertlos">
<icon BUILTIN="smiley-neutral"/> <icon BUILTIN="smiley-neutral"/>
@ -164337,8 +164340,13 @@ Since then others have made contributions, see the log for the history.</font></
<node COLOR="#435e98" CREATED="1748829133428" ID="ID_266502224" MODIFIED="1748884086384" TEXT="Tuple"> <node COLOR="#435e98" CREATED="1748829133428" ID="ID_266502224" MODIFIED="1748884086384" TEXT="Tuple">
<node COLOR="#435e98" CREATED="1748829135672" ID="ID_1078202790" MODIFIED="1748884086383" TEXT="tuple-record-init"> <node COLOR="#435e98" CREATED="1748829135672" ID="ID_1078202790" MODIFIED="1748884086383" TEXT="tuple-record-init">
<node CREATED="1748869115796" ID="ID_508891239" MODIFIED="1748869125930" TEXT="sehr wichtig f&#xfc;r GenNode via UI-Bus"/> <node CREATED="1748869115796" ID="ID_508891239" MODIFIED="1748869125930" TEXT="sehr wichtig f&#xfc;r GenNode via UI-Bus"/>
<node CREATED="1748869126637" ID="ID_1892597632" MODIFIED="1748869141216" TEXT="verwendet Type-Sequenze lediglich zum Re-binding eines Tuple-Typs"/> <node CREATED="1748869126637" ID="ID_1892597632" MODIFIED="1748981004421" TEXT="verwendet Type-Sequenzen lediglich zum Re-binding eines Tuple-Typs"/>
<node COLOR="#338800" CREATED="1748869141825" ID="ID_893825351" MODIFIED="1748869166877" TEXT="kann man einfach auf die neue Variante schwenken"> <node COLOR="#5b280f" CREATED="1748981138071" ID="ID_220397662" MODIFIED="1748981217303" TEXT="braucht aber einen IndexIter &#xfc;ber die neue Typ-Sequenz">
<arrowlink COLOR="#6479c8" DESTINATION="ID_1508249328" ENDARROW="Default" ENDINCLINATION="150;0;" ID="Arrow_ID_600905547" STARTARROW="None" STARTINCLINATION="148;7;"/>
<icon BUILTIN="messagebox_warning"/>
</node>
<node COLOR="#338800" CREATED="1748869141825" ID="ID_893825351" MODIFIED="1748980994720" TEXT="kann man auf die neue Variante schwenken">
<arrowlink DESTINATION="ID_717954051" ENDARROW="Default" ENDINCLINATION="633;0;" ID="Arrow_ID_791902372" STARTARROW="None" STARTINCLINATION="593;31;"/>
<icon BUILTIN="button_ok"/> <icon BUILTIN="button_ok"/>
</node> </node>
</node> </node>
@ -164348,7 +164356,13 @@ Since then others have made contributions, see the log for the history.</font></
</node> </node>
<node COLOR="#435e98" CREATED="1748829164245" ID="ID_1618911636" MODIFIED="1748884058416" TEXT="variadic-helper"> <node COLOR="#435e98" CREATED="1748829164245" ID="ID_1618911636" MODIFIED="1748884058416" TEXT="variadic-helper">
<node CREATED="1748830128123" ID="ID_450144323" MODIFIED="1748830132130" TEXT="(nur am Rande)"/> <node CREATED="1748830128123" ID="ID_450144323" MODIFIED="1748830132130" TEXT="(nur am Rande)"/>
<node CREATED="1748830132883" ID="ID_1589913777" MODIFIED="1748830138854" TEXT="IndexIter unterst&#xfc;tzt beide"/> <node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1748830132883" ID="ID_1589913777" MODIFIED="1748981232808" TEXT="IndexIter unterst&#xfc;tzt bisher nur die alte Type-Sequenz">
<icon BUILTIN="messagebox_warning"/>
</node>
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1748981101412" ID="ID_1508249328" MODIFIED="1748981221228" TEXT="Spezialsierung f&#xfc;r neue Type-Seq ist einfaches Rebinding auf den Argument-pack">
<linktarget COLOR="#6479c8" DESTINATION="ID_1508249328" ENDARROW="Default" ENDINCLINATION="150;0;" ID="Arrow_ID_600905547" SOURCE="ID_220397662" STARTARROW="None" STARTINCLINATION="148;7;"/>
<icon BUILTIN="idea"/>
</node>
<node CREATED="1748830139501" ID="ID_622177889" MODIFIED="1748830160252" TEXT="ElmTypes ist nur f&#xfc;r neue (variadisch) definiert"/> <node CREATED="1748830139501" ID="ID_622177889" MODIFIED="1748830160252" TEXT="ElmTypes ist nur f&#xfc;r neue (variadisch) definiert"/>
</node> </node>
<node CREATED="1748829176262" ID="ID_1246318914" MODIFIED="1748829178958" TEXT="Variant"/> <node CREATED="1748829176262" ID="ID_1246318914" MODIFIED="1748829178958" TEXT="Variant"/>
@ -164385,16 +164399,23 @@ Since then others have made contributions, see the log for the history.</font></
<linktarget COLOR="#a9b4c1" DESTINATION="ID_803058969" ENDARROW="Default" ENDINCLINATION="852;0;" ID="Arrow_ID_1971292758" SOURCE="ID_511778446" STARTARROW="None" STARTINCLINATION="302;17;"/> <linktarget COLOR="#a9b4c1" DESTINATION="ID_803058969" ENDARROW="Default" ENDINCLINATION="852;0;" ID="Arrow_ID_1971292758" SOURCE="ID_511778446" STARTARROW="None" STARTINCLINATION="302;17;"/>
</node> </node>
<node CREATED="1748829534601" MODIFIED="1748829534601" TEXT="MetaUtils_test"/> <node CREATED="1748829534601" MODIFIED="1748829534601" TEXT="MetaUtils_test"/>
<node CREATED="1748829542074" MODIFIED="1748829542074" TEXT="TupleHelper_test"/> <node COLOR="#435e98" CREATED="1748829542074" ID="ID_653647632" MODIFIED="1748960053937" TEXT="TupleHelper_test">
<node CREATED="1748829551216" MODIFIED="1748829551216" TEXT="TupleRecordInit_test"/> <linktarget COLOR="#a9b4c1" DESTINATION="ID_653647632" ENDARROW="Default" ENDINCLINATION="135;-20;" ID="Arrow_ID_1807168701" SOURCE="ID_145174722" STARTARROW="None" STARTINCLINATION="235;315;"/>
<node COLOR="#435e98" CREATED="1748829559066" ID="ID_1431343903" MODIFIED="1748900495968" TEXT="TypeListManip_test"> </node>
<linktarget COLOR="#a9b4c1" DESTINATION="ID_1431343903" ENDARROW="Default" ENDINCLINATION="156;-14;" ID="Arrow_ID_1374886089" SOURCE="ID_145174722" STARTARROW="None" STARTINCLINATION="253;316;"/> <node COLOR="#435e98" CREATED="1748829551216" ID="ID_717954051" MODIFIED="1748980987726" TEXT="TupleRecordInit_test">
<linktarget COLOR="#a9b4c1" DESTINATION="ID_717954051" ENDARROW="Default" ENDINCLINATION="96;-9;" ID="Arrow_ID_1349909689" SOURCE="ID_145174722" STARTARROW="None" STARTINCLINATION="264;361;"/>
<linktarget COLOR="#a9b4c1" DESTINATION="ID_717954051" ENDARROW="Default" ENDINCLINATION="633;0;" ID="Arrow_ID_791902372" SOURCE="ID_893825351" STARTARROW="None" STARTINCLINATION="593;31;"/>
</node>
<node COLOR="#435e98" CREATED="1748829559066" ID="ID_1431343903" MODIFIED="1748980907664" TEXT="TypeListManip_test">
<linktarget COLOR="#a9b4c1" DESTINATION="ID_1431343903" ENDARROW="Default" ENDINCLINATION="206;-13;" ID="Arrow_ID_1374886089" SOURCE="ID_145174722" STARTARROW="None" STARTINCLINATION="250;329;"/>
</node>
<node COLOR="#435e98" CREATED="1748829585985" ID="ID_665924488" MODIFIED="1748980925718" TEXT="TypeSeqManip_test">
<linktarget COLOR="#a9b4c1" DESTINATION="ID_665924488" ENDARROW="Default" ENDINCLINATION="358;-61;" ID="Arrow_ID_369345367" SOURCE="ID_145174722" STARTARROW="None" STARTINCLINATION="208;250;"/>
</node> </node>
<node CREATED="1748829567920" MODIFIED="1748829567920" TEXT="TypeList_test"/>
<node COLOR="#435e98" CREATED="1748829576396" ID="ID_281104576" MODIFIED="1748883754992" TEXT="TypeListUtil_test"> <node COLOR="#435e98" CREATED="1748829576396" ID="ID_281104576" MODIFIED="1748883754992" TEXT="TypeListUtil_test">
<linktarget COLOR="#a9b4c1" DESTINATION="ID_281104576" ENDARROW="Default" ENDINCLINATION="589;-82;" ID="Arrow_ID_351374746" SOURCE="ID_1470463237" STARTARROW="None" STARTINCLINATION="458;41;"/> <linktarget COLOR="#a9b4c1" DESTINATION="ID_281104576" ENDARROW="Default" ENDINCLINATION="589;-82;" ID="Arrow_ID_351374746" SOURCE="ID_1470463237" STARTARROW="None" STARTINCLINATION="458;41;"/>
</node> </node>
<node CREATED="1748829585985" MODIFIED="1748829585985" TEXT="TypeSeqManipl_test"/> <node CREATED="1748829567920" ID="ID_1097523075" MODIFIED="1748959903101" TEXT="TypeList_test"/>
<node CREATED="1748829607017" MODIFIED="1748829607017" TEXT="Variant_test"/> <node CREATED="1748829607017" MODIFIED="1748829607017" TEXT="Variant_test"/>
</node> </node>
</node> </node>