Created
January 3, 2026 01:27
-
-
Save dexter4life/55a06e8c08ba665c28e079367e598d2a to your computer and use it in GitHub Desktop.
Print tuple in c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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