I have the following C++ code:
template <class T1, class T2, class T3>
void MetaTypeHandler(T1 lambda1, T2 lambda2, T3 lambda3) {
lambda1(1);
lambda2('x');
lambda3(true);
}
int main() {
auto f = [] (auto x) {};
MetaTypeHandler(f,f,f);
}
Passing f
multiple times is ugly. Is it possible to write MetaTypeHandler()
so that f
is passed only 1 or 2 times? I think that template template parameters may help, but can't wrap my head around them.