Hacker News new | ask | show | jobs
by spanishgum 2115 days ago
How about `std::make_from_tuple` for constructors or `std::apply` for functions (C++17)?

It might be a bit verbose, but I think I would still prefer this over native syntax for unpacking.

2 comments

Why would you kill your compile times like that.
This mostly solves the unpacking problem. Thus, there are only two problems left:

1. I need to handcraft the tuple type myself, and make sure it matches the function declaration. (In other words, I don't want to manually write tuple<char, short>. I want to write foo::arg_tuple.)

2. This provides no support for named parameters. Tuples in C++ are numbered, not named.