From: "Ben Combee" <[EMAIL PROTECTED]>
>
> Looking at the C++ standard, the behavior here is determined by section
> 12.8, "Copying class objects".  The implicitly defined copy constructor
has
> several requirements:
>
> 1) perform a memberwise copy of its subobjects
> 2) order of copying is the same as the of initiation of its base classes
> and members in a user-defined constructor

I don't have the standard in front of me, but I would've expected it to say
that an implementation must appear from the outside as if those two
requirements were met, but that it can certainly optimize a simple struct
copy without regard to them. In other words, I do not believe the standard
really requires memberwise copy in implementation.

> #pragma block_assign on
>
> to your source files or header file.  It is not enabled by default because
> it can cause missed optimization opportunities for some code because the
> compiler is no longer able to split a single struct into multiple scalar
> variables for independent assignment to registers or the stack.

Can't the optimizer tell when it should do a block assignment?


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to