diff --git a/research/try.cpp b/research/try.cpp index 818929e1c..1165a5ba7 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -219,6 +219,70 @@ buildTuple (SRC values) } +////////////////////////TODO reworked for function-closure.hpp + + template + struct PartiallyInitTuple + { + template + using DestType = typename std::tuple_element::type; + + + /** + * define those index positions in the target tuple, + * where init arguments shall be used on construction. + * All other arguments will just be default initialised. + */ + static constexpr bool + useArg (size_t idx) + { + return (start <= idx) + and (idx < start + std::tuple_size()); + } + + + + template + struct IndexMapper + { + SRC const& initArgs; + + operator DestType() + { + return std::get (initArgs); + } + }; + + template + struct IndexMapper + { + SRC const& initArgs; + + operator DestType() + { + return DestType(); + } + }; + }; + + +template +struct SomeArgs + { + + template + using IdxSelector = typename PartiallyInitTuple::template IndexMapper; + + static Tuple + doIt (Tuple const& args) + { + using IndexSeq = typename IndexIter::Seq; + + return TupleConstructor (args); + } + }; +////////////////////////TODO reworked for function-closure.hpp + @@ -276,6 +340,8 @@ main (int, char**) cout << buildTuple (args) < (urgs) <::doIt(std::make_tuple("hui", 88)) <