| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Dec 20, 2006 10:10 am Post subject: Question about virtual |
|
|
I have two classes. One with a regular destructor and the other with a
virtual destructor.
e.g.
class x {
~x(){}
}
vs
class y {
virtual ~x{}
}
Question:
1. is y likely to use more memory?
2. is the construct y likely to be slower?
as i understand, it is less efficient when calling y...but i m not sure
about the memory and construction..
Thanks! |
|
| Back to top |
|
 |
Alf P. Steinbach Guest
|
Posted: Wed Dec 20, 2006 10:10 am Post subject: Re: Question about virtual |
|
|
* cwc5w (AT) hotmail (DOT) com:
| Quote: | I have two classes. One with a regular destructor and the other with a
virtual destructor.
e.g.
class x {
~x(){}
}
vs
class y {
virtual ~x{}
}
Question:
1. is y likely to use more memory?
2. is the construct y likely to be slower?
|
Premature optimization (or pessimization) is evil.
Measure.
Then don't do it.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? |
|
| Back to top |
|
 |
|