Consider we have an add
function declared like this:
int add(const int a, const int b);
If we were to return this add
function from foo
...
std::function<int(const int, const int)> foo()
{
return add;
}
std::function<int(const int, const int)> foo()
{
return &add;
}
Which one of the above is the correct way of returning a function object since both work exactly the same?