#include <iostream>
using namespace std;
// 再帰終端用のダミー関数。
void f(){}
template<typename ... ReturnTypes,typename ... ParamterTypes>
void f( int(&t)(ParamterTypes...), ReturnTypes(&...rest)(ParamterTypes ...)){
// とりあえずtを呼び出してみる
t(ParamterTypes()...);
// 再帰
f(rest...);
}
int g1(char c, long l){
std::cout << "call g1()" << std::endl;
return 0;
}
int g2( char c, long l ){
std::cout << "call g2()" << std::endl;
return 0;
}
int main() {
f(g1,g2);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8g5YaN5biw57WC56uv55So44Gu44OA44Of44O86Zai5pWw44CCCnZvaWQgZigpe30KCnRlbXBsYXRlPHR5cGVuYW1lIC4uLiBSZXR1cm5UeXBlcyx0eXBlbmFtZSAuLi4gUGFyYW10ZXJUeXBlcz4Kdm9pZCBmKCBpbnQoJnQpKFBhcmFtdGVyVHlwZXMuLi4pLCBSZXR1cm5UeXBlcygmLi4ucmVzdCkoUGFyYW10ZXJUeXBlcyAuLi4pKXsKICAgIC8vIOOBqOOCiuOBguOBiOOBmnTjgpLlkbzjgbPlh7rjgZfjgabjgb/jgosKICAgIHQoUGFyYW10ZXJUeXBlcygpLi4uKTsKCiAgICAvLyDlho3luLAKICAgIGYocmVzdC4uLik7Cn0KCgppbnQgZzEoY2hhciBjLCBsb25nIGwpewogICAgc3RkOjpjb3V0IDw8ICJjYWxsIGcxKCkiIDw8IHN0ZDo6ZW5kbDsKICAgIHJldHVybiAwOwp9CmludCBnMiggY2hhciBjLCBsb25nIGwgKXsKICAgIHN0ZDo6Y291dCA8PCAiY2FsbCBnMigpIiA8PCBzdGQ6OmVuZGw7CiAgICByZXR1cm4gMDsKfQoKCmludCBtYWluKCkgewogICAgZihnMSxnMik7CglyZXR1cm4gMDsKfQ==