Deriving an abstract class from concrete class

后端 未结 7 829
囚心锁ツ
囚心锁ツ 2021-02-05 16:05

Let\'s say we have a concrete class Apple. (Apple objects can be instantiated.) Now, someone comes and derives an abstract class Peach from Apple. It\'

相关标签:
7条回答
  • 2021-02-05 16:52

    Hmmm...by thinking "what a....." for a couple of seconds, I come to a conclusion it is not common... Also, I would not derive Peach from Apple and Tomato from Berry...do you have any better example?:)

    It's a lot of weird shit you can do in C++...I can't even think of 1% of it...

    About override a virtual with a pure virtual, you can probably just hide it and it will be really weird...

    If you can find a stupid C++ compiler that would link this function as a virtual, then you will get runtime pure virtual function call...

    I think this can only be done for a hack and I have no idea what kind of hack really...

    0 讨论(0)
提交回复
热议问题