Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.14 KB

ZipWithVariadic.md

File metadata and controls

39 lines (30 loc) · 1.14 KB

<CppML/Algorithm/ZipWithVariadic.hpp>

ZipWithVariadic

template <template <class...> With, typename Pipe = ml::ToList>
struct ZipWithVariadic {
  template <typename ...Ts>
  using f = /* .... */;
};

ZipWithVariadic<With, Pipe>

ZipWithVariadic<With, Pipe> is a metafunction takes a parameter pack of ml::ListT<Ts...>...., ml::ListT<Us...>... and passes to Pipe a parameter pack With<T0, U0, ...> ... With<Tn, Un, ...>. Pipe defaults to ml::ToList.

f:: ml::ListT<Ts...>, ml::ListT<Us...>... -> With<T0, U0, ...> ... With<Tn, Un, ...> >-> Pipe

With

With must be a variadic template.

NOTE: for non-variadic template With, see ml::ZipWith.

Example

using T0 = ml::f<
                 ml::ZipWithVariadic<std::pair>,
                 ml::ListT<int, char>,
                 ml::ListT<float, double>>;
static_assert(
              std::is_same_v<
                  T,
                  ml::ListT<
                      std::pair<int, float>,
                      std::pair<char, double>>>);