Quote Originally Posted by abeginner View Post
Paul Mckenzie,
Whether a ctor is correct or not depends upon what it is expected to do per design. it is not clear whether the designer expected ctor to allocate memory for long *p. If yes, then ctor does not do what was expected. If no, it is ok for the isolated case in question.
one can not use memset in general. even though advatage could be reduced overhead wrt to initialization of each member, what about const members? can they be memset? clearly memset can not be used if the ctor was expected to allocate memory to class member ptrs.
You are overthinking the reasoning why the code is faulty. I answered you in the other thread.

The bottom line -- don't code that way.

Regards,

Paul McKenzie