On May 7, 10:30 pm, "Chris Thomasson" <cris...@[EMAIL PROTECTED]
> wrote:
> "James Kanze" <james.ka...@[EMAIL PROTECTED]
> wrote in message
>
news:930a9325-6d39-4c58-be22-d21cd8545e9c@[EMAIL PROTECTED]
[...]
> > I'm not sure what you mean by "global ctor/dtors". You probably
> > cannot count on dynamic initialization of variables with static
> > lifetime, for obvious reasons, but there's certainly no reason
> > not to use (and a lot of reasons for using) user defined
> > constructors and destructors on local objects.
> Yeah, your right. However, I did not use them out of habit
> back when I was working on a toy x86 kernel implementation.
> Some objects may need to interface with assembly language. I
> personally find that using POD makes can make that process a
> bit easier...
Interfacing with assembler is another theme. Throw in some
privates and publics, virtual functions and a bit of
inheritance, and figuring out the layout in assembler isn't
going to be trivial. I've never found a compiler where just
adding a constructor or destructor to what would otherwise be a
POD changed the layout in anyway, however. (On the other hand,
whatever reasons made you want a destructor could very well
impact on how you use the class in assembler. Interfacing with
assembler is one place where char[] beats std::string hands
down.)
--
James Kanze (GABI Software) email:james.kanze@[EMAIL PROTECTED]
en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34


|