This is the mail archive of the
mailing list for the GCC project.
two constructor copies question, again
- From: "Clint Laschkewitsch" <clintl at us dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 25 Nov 2002 12:37:39 -0600
- Subject: two constructor copies question, again
On Jan 16, 2002 Rogeleio M Serrano Jr. asked why there were two copies of a
constructor being generated in the object file.
Alexandre Oliva responded that one was for full-object construction and one
was for sub-object construction.
Could you please clarify for me what you mean by sub-object? Is another
constructor needed if the first class is sub-classed? And if so, why?
What is the problem being solved?
I'm working in an embedded system environment where space is a premium. I
have several C++ classes which have a fair amount of logic in the
constructor and getting 2 copies of this code is a problem. Is there any
way to prevent getting two copies?
I assume the 2 destructors are for the same reason?
Thanks for the help.