#include<iostream>

using namespace std;

struct Add
{
template <typename A, typename B> A operator()(const A& lhs , const B& rhs)
{ return lhs+rhs; }
};

//some other ops

template <typename op, class A, class B >
A operate(A Fnum, B Snum){
op oper;
return oper(Fnum, Snum);
}
 
int main(){
int a = 20, b= 30;
std::cout<< operate<Add>(a,b)<<std::endl;
}
 