Name lookup take place before access control


class A {
	void f(int);
public:
	void f(long);
	void f(double);
};
void g() {
	A().f(1L); // OK
	A().f(1.); // OK
	A().f(10); // error
}

Yes, "1." is a floating point number.


posted on 2011-12-24 18:03  能发波  阅读(96)  评论(0)    收藏  举报

导航