Suppose I have this function:
template<typename...T> void doSomething() {
}
and I call it :
doSomething<ClassA, ClassB, ClassC>();
How can I access these classes in the "doSomething()" function?
The pack expansion T... is a comma-separated list of each type in the parameter pack T, or nothing if the pack is empty. That is, use the ellipsis.
To index parameter packs arbitrarily (i.e., to access the Ith element of the parameter pack), say std::tuple_element_t<I, std::tuple<Ts...>>.
What is doSomething()?
Last edited on
"doSomething()" is just a method in which I want to access the Ts that are passed in.