Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: