int a = 1;
int b = 2;
std::function<int(int, int)> op = std::plus<int>();
int c = op(a, b);
if (c == 3)
Replace std::plus<>on std::minus<>, std::multiplies<>, std::divides<>and so on, if necessary. All of them are located in the header functional, so be sure #include <functional>.
Replace std::function<> boost::function<>if you are not using a recent compiler.