Why in the next program the member function foo has priority over the global foo although the global one match the type?
#include <iostream>
using namespace std;
void foo(double val) { cout << "double\n";}
class obj {
public:
void callFoo() { foo(6.4); }
private:
void foo(int val) {cout << "class member foo\n"; }
};
int main() {
obj o;
o.callFoo();
}