mercredi 8 janvier 2020

How to use types in a parameter pack?

I'm new to c++11 and trying to make a function that runs objects

template<size_t I, typename... T>
void fun() {
    // use T here, may be something like
    // std::tuple_element<I, std::tuple<T...>>::type i;
    // i.run();
}

I don't know how to use the type in parameter pack, what's the correct grammar for this?

Aucun commentaire:

Enregistrer un commentaire