diff --git a/src/lib/meta/tuple-helper.hpp b/src/lib/meta/tuple-helper.hpp index e248bfb05..2433fd64f 100644 --- a/src/lib/meta/tuple-helper.hpp +++ b/src/lib/meta/tuple-helper.hpp @@ -129,13 +129,13 @@ namespace meta { /** temporary workaround: match and rebind the type sequence from a tuple */ template - struct RebindTySeq + struct RebindTupleTypes { using Seq = typename Types::Seq; using List = typename Seq::List; }; template - struct RebindTySeq> + struct RebindTupleTypes> { using Seq = typename Types::Seq; using List = typename Seq::List; diff --git a/src/lib/meta/variadic-helper.hpp b/src/lib/meta/variadic-helper.hpp index 460e9b662..d3f77902d 100644 --- a/src/lib/meta/variadic-helper.hpp +++ b/src/lib/meta/variadic-helper.hpp @@ -60,6 +60,7 @@ namespace lib { namespace meta { + //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #987 temporary WORKAROUND -- to be obsoleted /** * temporary workaround: * alternative definition of "type sequence", @@ -117,6 +118,7 @@ namespace meta { { using Seq = TySeq<>; // NOTE: this causes the result to be a TySeq }; + //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #987 temporary WORKAROUND(End) -- to be obsoleted @@ -144,6 +146,10 @@ namespace meta { + + /* ==== Build Variadic Sequences ==== **/ + + /** Hold a sequence of index numbers as template parameters */ template struct IndexSeq @@ -230,7 +236,7 @@ namespace meta { template struct BuildIdxIter> { - /////TODO as long as Types is not variadic (#987), we need to strip NullType here (instead of just using sizeof...(TYPES) + ///////////////////////TICKET #987 : since Types is not variadic, need to strip NullType here (instead of just using sizeof...(TYPES) enum {SIZ = lib::meta::count::List>::value }; using Builder = BuildIndexSeq; @@ -254,6 +260,34 @@ namespace meta { + /* ==== Rebinding Variadic Arguments ==== **/ + + /** + * Metaprogramming helper to transfer variadic arguments. + * - builds a new type instantiation from the Template \a X + * - possibly picks up the variadic argument pack from a given + * source template `U` + * @tparam X a variadic template + */ + template class X, typename...ARGS> + struct RebindVariadic + { + using Type = X; + }; + + template class X + ,template class U + ,typename...ARGS> + struct RebindVariadic> + { + using Type = X; + }; + + + + + + /* ==== Manipulation of variadic arguments ==== **/ diff --git a/src/steam/control/command-simple-closure.hpp b/src/steam/control/command-simple-closure.hpp index dc10d49f5..86591a755 100644 --- a/src/steam/control/command-simple-closure.hpp +++ b/src/steam/control/command-simple-closure.hpp @@ -80,7 +80,7 @@ namespace control { using ArgumentBuff = InPlaceBuffer; using ArgTuple = typename ArgHolder::ArgTuple; - using Args = typename lib::meta::RebindTySeq::Seq; // std::tuple to Types + using Args = typename lib::meta::RebindTupleTypes::Seq; // std::tuple to Types /* ====== in-place argument storage ====== */ diff --git a/src/steam/control/command-storage-holder.hpp b/src/steam/control/command-storage-holder.hpp index 236c228a8..3913b385f 100644 --- a/src/steam/control/command-storage-holder.hpp +++ b/src/steam/control/command-storage-holder.hpp @@ -86,7 +86,7 @@ namespace control { using MementoBuff = InPlaceBuffer; using ArgTuple = typename ArgHolder::ArgTuple; - using Args = typename lib::meta::RebindTySeq::Seq; // std::tuple to Types + using Args = typename lib::meta::RebindTupleTypes::Seq; // std::tuple to Types /* ====== in-place storage buffers ====== */ diff --git a/tests/library/meta/tuple-diagnostics.hpp b/tests/library/meta/tuple-diagnostics.hpp index 019c013b9..7f123a848 100644 --- a/tests/library/meta/tuple-diagnostics.hpp +++ b/tests/library/meta/tuple-diagnostics.hpp @@ -80,7 +80,7 @@ namespace test { string > showType () { - using TypeList = typename RebindTySeq::List; + using TypeList = typename RebindTupleTypes::List; using DumpPrinter = InstantiateChained; return "TUPLE" diff --git a/tests/library/meta/tuple-helper-test.cpp b/tests/library/meta/tuple-helper-test.cpp index 477783d55..790ff757b 100644 --- a/tests/library/meta/tuple-helper-test.cpp +++ b/tests/library/meta/tuple-helper-test.cpp @@ -117,10 +117,10 @@ namespace test { void check_tuple_from_Typelist() { - typedef Types1::List L1; // starting from an existing Typelist... + using L1 = Types1::List; // ... start from existing Typelist... - typedef Tuple T_L1; // derive a tuple type from this typelist - typedef RebindTySeq::Seq Seq1; + using T_L1 = Tuple; // derive a tuple type from this typelist + using Seq1 = RebindTupleTypes::Seq; // extract the underlying type sequence DISPLAY (T_L1); DISPLAY (Seq1); diff --git a/tests/vault/gear/activity-detector.hpp b/tests/vault/gear/activity-detector.hpp index 3efad9b3b..73a41be24 100644 --- a/tests/vault/gear/activity-detector.hpp +++ b/tests/vault/gear/activity-detector.hpp @@ -85,6 +85,7 @@ namespace test { // using lib::time::TimeValue; // using lib::time::Time; // using lib::HashVal; + using lib::meta::RebindVariadic; using util::isnil; // using util::isSameObject; // using fixture::Segmentation; @@ -92,22 +93,6 @@ namespace test { // using vault::gear::Job; // using vault::gear::JobClosure; - namespace { - template class X, typename...ARGS> - struct _RebindTypeSeq - { - using Type = X; - }; - - template class X - ,template class U - ,typename...ARGS> - struct _RebindTypeSeq> - { - using Type = X; - }; - - } /** @@ -191,7 +176,7 @@ namespace test { using Args = typename lib::meta::_Fun::Args; using ArgsX = typename lib::meta::StripNullType::Seq; ////////////////////////////////////TICKET #987 : make lib::meta::Types variadic using SigTypes = typename lib::meta::Prepend::Seq; - using Functor = typename _RebindTypeSeq::Type; + using Functor = typename RebindVariadic::Type; return Functor{id, eventLog_}; } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 6d8280551..fca93d175 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -81678,8 +81678,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + +