Arthur O'Dwyer wrote:
Here's one more semi-common idiom that we ran into at the time:
Foo::Foo() {
memset(this, '\0', sizeof *this); // most of my fields should be
false or zero
this->should_be_true = true; // initialize only the interesting ones
}
This should definitely warn if there is a vptr overwritten by the memset.
Cheers,
Gabor