#include <stdio.h>
#include <functional>
int foo(int x)
{
return x;
}
int foo(int a, int b)
{
return a + b;
}
int main()
{
std::function<int(int)> guiFunc2 = foo; //error : no suitable constructor exists to convert from "<unknown-type>" to "std::function<int(int)>"
std::function<int(int, int)> guiFunc1 = foo; //error : no suitable constructor exists to convert from "<unknown-type>" to "std::function<int(int, int)>"
return 0;
}
I want to make two function pointers to functions with same name but this code does not work.
It's easy to just change the functions name but I would like to know if it's possible to make funtion pointers with same name.
Thanks.