#include<thread>
#include<iostream>
using std::cout;
void foo(int a){
cout<<a;
}
template <typename T>
void goo(void (*fn)(T),T c){
fn(c);
}
int main(void)
{
std::thread TH;
void (*ptr)(int)=foo;
TH= std::thread(&goo<int>,ptr,1);
TH.join();
return 0;
}
I2luY2x1ZGU8dGhyZWFkPgojaW5jbHVkZTxpb3N0cmVhbT4KCnVzaW5nIHN0ZDo6Y291dDsKdm9pZCBmb28oaW50IGEpewogICAgY291dDw8YTsKfQoKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+CnZvaWQgZ29vKHZvaWQgKCpmbikoVCksVCBjKXsKICAgIGZuKGMpOwp9CgppbnQgbWFpbih2b2lkKQp7CiAgICBzdGQ6OnRocmVhZCBUSDsKICAgIHZvaWQgKCpwdHIpKGludCk9Zm9vOwogICAgVEg9IHN0ZDo6dGhyZWFkKCZnb288aW50PixwdHIsMSk7CiAgICBUSC5qb2luKCk7CgogICAgcmV0dXJuIDA7Cn0K