Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Programmer > Re: Rusty's mes...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 52600 of 53449
Post > Topic >>

Re: Rusty's message to C++ programmers (C or C++)

by James Kanze <james.kanze@[EMAIL PROTECTED] > May 9, 2008 at 02:42 AM

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
 




 1 Posts in Topic:
Re: Rusty's message to C++ programmers (C or C++)
James Kanze <james.kan  2008-05-09 02:42:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 5 19:14:17 CDT 2008.