Skip to content

Instantly share code, notes, and snippets.

@dexter4life
Created January 3, 2026 01:27
Show Gist options
  • Select an option

  • Save dexter4life/55a06e8c08ba665c28e079367e598d2a to your computer and use it in GitHub Desktop.

Select an option

Save dexter4life/55a06e8c08ba665c28e079367e598d2a to your computer and use it in GitHub Desktop.
Print tuple in c++
template <typename Tuple> void print_tuple(const Tuple& t)
{
return [&]<std::size_t... Is>(std::index_sequence<Is...>) {
((std::cout << (Is == 0 ? "" : ", ") << std::get<Is>(t)), ...);
}(std::make_index_sequence<std::tuple_size_v<Tuple>>());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment