L
laikon
dear, all:
below is a function with a parameter of function pointer.
void f(int a, int b, int (*fp)(int, int))
{
std::cout << fp(a, b) << std::endl;
}
and f is called with functor plus as 3rd argument.
int x = 2, y = 3;
f(x, y, std:lus<int>());
but it raises an error, and how to solve it?
Thanks a lot.
below is a function with a parameter of function pointer.
void f(int a, int b, int (*fp)(int, int))
{
std::cout << fp(a, b) << std::endl;
}
and f is called with functor plus as 3rd argument.
int x = 2, y = 3;
f(x, y, std:lus<int>());
but it raises an error, and how to solve it?
Thanks a lot.