Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 759 Bytes

Tail.md

File metadata and controls

32 lines (25 loc) · 759 Bytes

<CppML/Pack/Tail.hpp>

Tail

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

Tail<N, Pipe>

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

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

Example

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