Code Style

janderson askme at me.com
Sun Jun 17 00:53:19 PDT 2007


Jarrett Billingsley wrote:
> "janderson" <askme at me.com> wrote in message 
> news:f51ll5$1hv6$1 at digitalmars.com...
>> Also it would be nice if you could sort properties by type, such that the 
>> largest types are first, for better alignment.
> 
> This is (or at least can be) done by the compiler.  Class fields may be 
> arbitrarily rearranged for optimal layout.  Struct fields, however, are 
> always in the order and alignment that you specify. 
> 
> 

The problem is, when its done by the compiler, you have problems when 
doing memory streaming operations on the data.  Of course u could always 
use a struct but then its still better if they are in the correct order.

-Joel



More information about the Digitalmars-d mailing list