I would like to pass multiple arguments in order to construct two objects inside a function, the same way std::pair<T1, T2>(std::piecewise_construct, ...)
works.
So I wrote
template <typename Args0..., typename Args1...>
void f(std::tuple<Arg0> args0, std::tuple<Args1> args1) {
Object0 alpha(...);
Object1 beta(...);
...
}
so I can call
f(std::forward_as_tuple(..., ..., ...), std::forward_as_tuple(..., ...))
But I don't know how to construct Object0
and Object1
. I have checked the source code of my standard library for std::pair
and they seems to use complicated internal functions to get the indices of args0 and args1. Do you have any idea on how to do that?