由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Help! Virtual Destructor
相关主题
some C++ interview questionsCan we define pure virtual function? (转载)
急问:compile and build dependencyInterview question: is the following code OK?
C++含有指针成员的类new一定要和delete配对吗?
[合集] can destructor be pure virtual function in c++?Forward declaration with unique_ptr
请问2个类的问题请教个Bloomberg 的 C++ 题目
用包子呼唤大牛们--问关于C++Destructor的问题[C++] when destructors get called
private destructor【C++】请问这样有没有memory leak?多谢
Two questions on virtual destructor[合集] c++里面到底destructor是不是要virtual的?
相关话题的讨论汇总
话题: 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版参与讨论
相关主题
[合集] c++里面到底destructor是不是要virtual的?请问2个类的问题
请教智能指针shared_ptr implementation问题用包子呼唤大牛们--问关于C++Destructor的问题
关于内存泄漏private destructor
A try-catch problem in C++Two questions on virtual destructor
some C++ interview questionsCan we define pure virtual function? (转载)
急问:compile and build dependencyInterview question: is the following code OK?
C++含有指针成员的类new一定要和delete配对吗?
[合集] can destructor be pure virtual function in c++?Forward declaration with unique_ptr
相关话题的讨论汇总
话题: virtual话题: destructor话题: could话题: c++话题: usually