如果class A is abstract, class B is not a derived class of A. 下面的code可以运行吗? A* pa=new B();
b*n
2 楼
of course not
【在 i*c 的大作中提到】 : 如果class A is abstract, class B is not a derived class of A. : 下面的code可以运行吗? : A* pa=new B();
i*c
3 楼
如果A和B都derive from C, 有可能吗?
【在 b********n 的大作中提到】 : of course not
r*y
4 楼
no
【在 i*c 的大作中提到】 : 如果A和B都derive from C, 有可能吗?
N*s
5 楼
if 'new' is overloaded, maybe if '=' is overloaded, maybe
【在 i*c 的大作中提到】 : 如果class A is abstract, class B is not a derived class of A. : 下面的code可以运行吗? : A* pa=new B();
X*r
6 楼
No, no. The new operator and operator new are different. Overloading the latter won't change the return type of the former. operator = is not even part of function lookup here. This is a declarator with an initializer.
【在 N**s 的大作中提到】 : if 'new' is overloaded, maybe : if '=' is overloaded, maybe