#include <iostream>
#include <tuple>
namespace aux{
template<std::size_t...> struct seq{};
template<std::size_t N, std::size_t... Is>
struct gen_seq : gen_seq<N-1, N-1, Is...>{};
template<std::size_t... Is>
struct gen_seq<0, Is...> : seq<Is...>{};
template<class Ch, class Tr, class Tuple, std::size_t... Is>
void print_tuple(std::basic_ostream<Ch,Tr>& os, Tuple const& t, seq<Is...>){
using swallow = int[];
(void)swallow{0, (void(os << (Is == 0? "" : ", ") << std::get<Is>(t)), 0)...};
}
} // aux::
template<class Ch, class Tr, class... Args>
auto operator<<(std::basic_ostream<Ch, Tr>& os, std::tuple<Args...> const& t)
-> std::basic_ostream<Ch, Tr>&
{
os << "(";
aux::print_tuple(os, t, aux::gen_seq<sizeof...(Args)>());
return os << ")";
}
int main(){
std::cout << std::make_tuple(5, "Hello", -0.1) << "\n";
std::cout << std::make_tuple() << "\n";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHVwbGU+CgpuYW1lc3BhY2UgYXV4ewp0ZW1wbGF0ZTxzdGQ6OnNpemVfdC4uLj4gc3RydWN0IHNlcXt9OwoKdGVtcGxhdGU8c3RkOjpzaXplX3QgTiwgc3RkOjpzaXplX3QuLi4gSXM+CnN0cnVjdCBnZW5fc2VxIDogZ2VuX3NlcTxOLTEsIE4tMSwgSXMuLi4+e307Cgp0ZW1wbGF0ZTxzdGQ6OnNpemVfdC4uLiBJcz4Kc3RydWN0IGdlbl9zZXE8MCwgSXMuLi4+IDogc2VxPElzLi4uPnt9OwoKdGVtcGxhdGU8Y2xhc3MgQ2gsIGNsYXNzIFRyLCBjbGFzcyBUdXBsZSwgc3RkOjpzaXplX3QuLi4gSXM+CnZvaWQgcHJpbnRfdHVwbGUoc3RkOjpiYXNpY19vc3RyZWFtPENoLFRyPiYgb3MsIFR1cGxlIGNvbnN0JiB0LCBzZXE8SXMuLi4+KXsKICB1c2luZyBzd2FsbG93ID0gaW50W107CiAgKHZvaWQpc3dhbGxvd3swLCAodm9pZChvc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