Answer the question
In order to leave comments, you need to log in
How to get an element by index in std::tuple for an unknown number of arguments?
Good afternoon!
Just a straight-forward question:
Why doesn't this construction compile?
template<typename... Args>
MotionState* MotionMaster::CreateStandartState(MotionStateId stateId, Args... args)
{
std::tuple<Args...> params = std::make_tuple(std::forward<Args>(args)...);
float x = std::get<0>(params);
float y = std::get<1>(params);
float z = std::get<2>(params);
...
}
Answer the question
In order to leave comments, you need to log in
stackoverflow.com/questions/687490/how-do-i-expand...
Expand into an array and take from there by index.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question