B
Bonj
Hello,
Can anyone help me with these fairly simple questions.
1) What is the point in virtual destructors - I've heard it's a good thing
for base-classes, but what are the advantages and disadvantages of doing so
/ or not as the case maybe?
2) In the following example, are code sections BD and DD *both* going to get
called? I assume they both always will, but is this guaranteed beyond all
odds in all cases? (When I say is it guaranteed - I mean will they both get
called *at some point*, not necessarily in any particular order)
class B
{
B() {}
virtual ~B() {// code BD //}
};
class D : public B
{
D() {}
virtual ~D() {//code DD//}
};
Can anyone help me with these fairly simple questions.
1) What is the point in virtual destructors - I've heard it's a good thing
for base-classes, but what are the advantages and disadvantages of doing so
/ or not as the case maybe?
2) In the following example, are code sections BD and DD *both* going to get
called? I assume they both always will, but is this guaranteed beyond all
odds in all cases? (When I say is it guaranteed - I mean will they both get
called *at some point*, not necessarily in any particular order)
class B
{
B() {}
virtual ~B() {// code BD //}
};
class D : public B
{
D() {}
virtual ~D() {//code DD//}
};