This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

Clint Laschkewitsch



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]