i*c 发帖数: 1132 | 1 如果class A is abstract, class B is not a derived class of A.
下面的code可以运行吗?
A* pa=new B(); |
b********n 发帖数: 609 | 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 发帖数: 1132 | 3 如果A和B都derive from C, 有可能吗?
【在 b********n 的大作中提到】 : of course not
|
r*******y 发帖数: 290 | 4 no
【在 i*c 的大作中提到】 : 如果A和B都derive from C, 有可能吗?
|
N**s 发帖数: 837 | 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 发帖数: 3557 | 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
|