#include<functional>
#include<iostream>
template < class T, typename F >
T fn(T a, T b, F f)
{
return f<T>()(a,b);
}
template<class T>
struct X
{
template < typename F>
T foo(T a, T b, F f)
{
return fn<T, F>(a,b,f);
}
};
int main()
{
int a = 1;
int b = 1;
X<int> f;
std::cout<< f.foo(a,b, std::plus<int>);
return 0;
}