|
-
September 28th, 2009, 01:54 PM
#13
Re: what changes to class lead to recompile?
 Originally Posted by abeginner
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|