// { dg-do compile { target c++14 } } namespace std { typedef int size_t; template struct index_sequence {}; } template class Tuple {}; template auto get(Tuple) { return TFirst(); } template auto apply_impl(Functor f, T1 t1, T2 t2) { return f(get(t1), get(t2)); } template auto map_impl(std::index_sequence, Functor f, T1 t1, T2 t2) { Tuple(f, t1, t2))...>(); } template auto map_impl(Functor f, T1 t1, T2 t2) { map_impl(std::index_sequence<0>(), f, t1, t2); } struct Less { template auto operator()(Lhs lhs, Rhs rhs) -> decltype(lhs < rhs) { return lhs < rhs; } }; int main() { auto t1 = Tuple(); auto t2 = Tuple(); map_impl(Less(), t1, t2); }