template typename cast int return int main boost function int int cast

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
template <typename T>
T cast(int* x)
{
return T();
}
int main()
{
boost::function<int (int*)> f (cast<int>);
}