jeudi 5 mars 2015

Recursive variadic function template

I want to write a class method that takes a template parameter pack, but zero arguments, and "iterate" over the types:



struct Bar {
template <typename T, typename... Ts>
void foo() {
// something with T that involves Bar's members
foo<Ts...>();
}
};


What is the preferred way to implement this?


Aucun commentaire:

Enregistrer un commentaire