| |

VerySource

 Forgot password?
 Register
Search
Author: 心碎飞了

About virtual destructor

[Copy link]

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2021-3-9 08:30:02
| Show all posts
There is no inheritance of destructors, and subclasses have their own destructors.
Using virtual is the problem of override. Generally, virtual functions are used in the parent class, and the subclass will implement the function with the same name. If it is inherited, should it be implemented by itself? So obviously this is not for inheritance.


So the concept of cuddling is wrong: virtual! = Inheritance
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2021-3-9 09:00:01
| Show all posts
The concept is not clear
Inheritance is inheritance, polymorphism is polymorphism
Reply

Use magic Report

1

Threads

13

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2021-3-9 09:30:01
| Show all posts
Sorry, novice, the code is really small and not smart, so the problem is always so many, please bear with me*~_~*
thank you all!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list