Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 759 Bytes

Head.md

File metadata and controls

32 lines (25 loc) · 759 Bytes

<CppML/Pack/Head.hpp>

Head

template <int N, typename Pipe = ml::ToList>
struct Head {
  template <typename ...Ts>
  using f = /* .... */;
};

Head<N, Pipe>

Head<N, Pipe> is a metafunction that passes to Pipe the parameter pack T0, T1, ..., T_{N-1}, which is generated by taking the first N elements of the parameter pack Ts.... Pipe defaults to ml::ToList.

f:: T0, T1, ..., T_{N-1}, T's... -> T0, T1, ..., T_{N-1} >-> Pipe

Example

using AF = ml::Head<2, ml::F<std::tuple>>;
using T = ml::f<
               AF,
               int, char, bool, double>;
static_assert(
              std::is_same_v<
                  T,
                  std::tuple<int, char>>);