#include <iostream>
#include <string>
bool SomeFunc(int a)
{
return a > 0;
}
int main()
{
typedef bool(*MyFunctionPointer)(int);
MyFunctionPointer foo = SomeFunc;
std::string result = foo(0) ? "Yay" : "Nay";
std::cout << result << std::endl;
using MyBetterFunctionPointer = bool(*)(int);
MyBetterFunctionPointer bar = SomeFunc;
result = bar(1) ? "Yay" : "Nay";
std::cout << result << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKYm9vbCBTb21lRnVuYyhpbnQgYSkKewoJcmV0dXJuIGEgPiAwOwkKfQoKaW50IG1haW4oKSAKewoJdHlwZWRlZiBib29sKCpNeUZ1bmN0aW9uUG9pbnRlcikoaW50KTsKCU15RnVuY3Rpb25Qb2ludGVyIGZvbyA9IFNvbWVGdW5jOwoJCglzdGQ6OnN0cmluZyByZXN1bHQgPSBmb28oMCkgPyAiWWF5IiA6ICJOYXkiOwoJc3RkOjpjb3V0IDw8IHJlc3VsdCA8PCBzdGQ6OmVuZGw7CgkKCXVzaW5nIE15QmV0dGVyRnVuY3Rpb25Qb2ludGVyID0gYm9vbCgqKShpbnQpOwoJTXlCZXR0ZXJGdW5jdGlvblBvaW50ZXIgYmFyID0gU29tZUZ1bmM7CgkKCXJlc3VsdCA9IGJhcigxKSA/ICJZYXkiIDogIk5heSI7CglzdGQ6OmNvdXQgPDwgcmVzdWx0IDw8IHN0ZDo6ZW5kbDsKCQoJcmV0dXJuIDA7Cn0=