avatar
C++ virtrual destructor# JobHunting - 待字闺中
r*y
1
costco买的,2个月没吃完就有味道了,是质量不行还是brown rice就这样?costco买
的whole wheat flour 也是这样
avatar
d*f
2
Class A
{
A(){};
virtual ~A(){};
}
Class B : public A
{
B(){};
~B(){};
};
是不是~B() 有无virtual是一样的?
avatar
o*p
3
保持干燥

【在 r********y 的大作中提到】
: costco买的,2个月没吃完就有味道了,是质量不行还是brown rice就这样?costco买
: 的whole wheat flour 也是这样

avatar
e*0
4
不行, base 定义了 析构函数是virtual,
derived必须也定义析构函数是virtual

【在 d**f 的大作中提到】
: Class A
: {
: A(){};
: virtual ~A(){};
: }
: Class B : public A
: {
: B(){};
: ~B(){};
: };

avatar
m*i
5
brown rice容易坏,需要冷藏/冷冻保存。室温俩月差不多了

【在 r********y 的大作中提到】
: costco买的,2个月没吃完就有味道了,是质量不行还是brown rice就这样?costco买
: 的whole wheat flour 也是这样

avatar
c*o
6
Note: in a derived class, if your base class has a virtual destructor, your
own destructor is automatically virtual. You might need an explicit
destructor for other reasons, but there's no need to redeclare a destructor
simply to make sure it is virtual. No matter whether you declare it with the
virtual keyword, declare it without the virtual keyword, or don't declare
it at all, it's still virtual.

【在 e******0 的大作中提到】
: 不行, base 定义了 析构函数是virtual,
: derived必须也定义析构函数是virtual

avatar
l*s
7
没开包的可以放久一点吧?
avatar
c*s
8
can't agree more...

your
destructor
the
declare

【在 c****o 的大作中提到】
: Note: in a derived class, if your base class has a virtual destructor, your
: own destructor is automatically virtual. You might need an explicit
: destructor for other reasons, but there's no need to redeclare a destructor
: simply to make sure it is virtual. No matter whether you declare it with the
: virtual keyword, declare it without the virtual keyword, or don't declare
: it at all, it's still virtual.

avatar
h*u
10
唉。这么简单的东东。动手试一下不就是了。当然,这个问题是应该脱口就能答出来的
avatar
H*J
12
变成啥味道了?怎么鉴别?谢谢

【在 r********y 的大作中提到】
: costco买的,2个月没吃完就有味道了,是质量不行还是brown rice就这样?costco买
: 的whole wheat flour 也是这样

avatar
u*s
13
谢包子,太客气了!

【在 r********y 的大作中提到】
: 谢,包子过去了
avatar
m*d
14
带胚芽的米是容易变质
可以放冰箱

【在 r********y 的大作中提到】
: costco买的,2个月没吃完就有味道了,是质量不行还是brown rice就这样?costco买
: 的whole wheat flour 也是这样

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。