#include <iostream>
using namespace std;
typedef int (*funct_ptr_good)(int, void *);
typedef int (*funct_ptr_bad)();
void foo(funct_ptr_bad fb) {
funct_ptr_good fg = reinterpret_cast<funct_ptr_good>(fb);
fg(12345, NULL);
}
int main() {
funct_ptr_good fg = [] (int key, void * ptr) -> int {
cout << key << " " << ptr << endl;
return 0;
};
foo(reinterpret_cast<funct_ptr_bad>(fg));
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdHlwZWRlZiBpbnQgKCpmdW5jdF9wdHJfZ29vZCkoaW50LCB2b2lkICopOwp0eXBlZGVmIGludCAoKmZ1bmN0X3B0cl9iYWQpKCk7Cgp2b2lkIGZvbyhmdW5jdF9wdHJfYmFkIGZiKSB7CglmdW5jdF9wdHJfZ29vZCBmZyA9IHJlaW50ZXJwcmV0X2Nhc3Q8ZnVuY3RfcHRyX2dvb2Q+KGZiKTsKCWZnKDEyMzQ1LCBOVUxMKTsKfQoKaW50IG1haW4oKSB7CglmdW5jdF9wdHJfZ29vZCBmZyA9IFtdIChpbnQga2V5LCB2b2lkICogcHRyKSAtPiBpbnQgewoJCWNvdXQgPDwga2V5IDw8ICIgIiA8PCBwdHIgPDwgZW5kbDsKCQlyZXR1cm4gMDsKCX07Cglmb28ocmVpbnRlcnByZXRfY2FzdDxmdW5jdF9wdHJfYmFkPihmZykpOwoJcmV0dXJuIDA7Cn0=