#include <tuple>
#include <memory>
template <typename Ret, typename... Is, typename... Js, typename Tuples>
{
static_assert(sizeof...(Is) == sizeof...(Js), "");
return Ret{std::get<Js::value>(std::get<Is::value>(std::forward<Tuples>(tpls)))...};
}
template <typename... Tuples,
Res tuple_cat(Tuples &&... tpls)
{
using list_of_list_of_inner_indices =
return tuple_cat_helper<Res>(inner{}, outer{},
std::forward_as_tuple(std::forward<Tuples>(tpls)...));
}
int main()
{
std::tuple<int, short, long> t1;
std::tuple<> t2;
std::tuple<float, double, long double> t3;
std::tuple<void *, char *> t4;
auto x = ::tuple_cat(t1, t2, t3, t4, std::make_tuple(std::unique_ptr<int>{}));
using expected_type = std::tuple<int, short, long, float, double, long double, void *, char *,
std::unique_ptr<int>>;
static_assert(std::is_same<decltype(x), expected_type>::value, "");
}