boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Help! Virtual Destructor
相关主题
some C++ interview questions
急问:compile and build dependency
C++含有指针成员的类
[合集] can destructor be pure virtual function in c++?
请问2个类的问题
用包子呼唤大牛们--问关于C++Destructor的问题
private destructor
Two questions on virtual destructor
Can we define pure virtual function? (转载)
Interview question: is the following code OK?
相关话题的讨论汇总
话题: virtual话题: destructor话题: could话题: c++话题: usually
进入Programming版参与讨论
1 (共1页)
w*********t
发帖数: 319
1
Could you tell me any situation not to use virtual destructor? Usually I use
virtual destructor in derived classes.
This might related embedded C++ software.
Thanks.
P*****f
发帖数: 2272
2
In emdedded environment, the resource is quite limited, e.g., the memory.
Make a virtual dtor will add a ptr to vtbl in each class instance. This
comsumes lots of memory if there are thousands of instances.

【在 w*********t 的大作中提到】
: Could you tell me any situation not to use virtual destructor? Usually I use
: virtual destructor in derived classes.
: This might related embedded C++ software.
: Thanks.

1 (共1页)
进入Programming版参与讨论
相关主题
Interview question: is the following code OK?
new一定要和delete配对吗?
Forward declaration with unique_ptr
请教个Bloomberg 的 C++ 题目
[C++] when destructors get called
【C++】请问这样有没有memory leak?多谢
[合集] c++里面到底destructor是不是要virtual的?
请教智能指针shared_ptr implementation问题
关于内存泄漏
A try-catch problem in C++
相关话题的讨论汇总
话题: virtual话题: destructor话题: could话题: c++话题: usually