|Optimizing structure layout firstname.lastname@example.org (1997-03-21)|
|Re: Optimizing structure layout email@example.com (Julian Dolby) (1997-03-22)|
|Re: Optimizing structure layout firstname.lastname@example.org.OZ.AU (1997-03-22)|
|Re: Optimizing structure layout email@example.com (Christopher Glaeser) (1997-03-22)|
|Re: Optimizing structure layout firstname.lastname@example.org (Michael Meissner) (1997-03-27)|
|Re: Optimizing structure layout email@example.com (David L Moore) (1997-03-27)|
|Re: Optimizing structure layout firstname.lastname@example.org (1997-03-31)|
|Re: Optimizing structure layout email@example.com (John Pieper) (1997-03-31)|
|Re: Optimizing structure layout firstname.lastname@example.org (Valentin Bonnard) (1997-03-31)|
|From:||email@example.com (Torbjorn Lindgren)|
|Date:||31 Mar 1997 15:22:42 -0500|
|Organization:||Funcom Oslo AS|
|Keywords:||storage, optimize, C++|
>> While it is quite common that compilers optimize the code they
>> produce, I haven't heard of a commonly used system that really
>> optimizes the layout of the data structures that are generated. Are
>> there such systems?
Michael Meissner <firstname.lastname@example.org> wrote:
>For many languages, it is impossible. C for one requires that
>structure members be laid out in the order the programmer wrote them.
>I believe C++ allows classes to be optimized, but again, not
There's very little differences between classes and structs in C++.
You aren't allowed to optimize POD-classes, and all ANSI C classes
fits the criterias for being POD-classes (likwise for ANSI C unions
and POD unions). Note however that I *suspect* that you can have
POD-classes too, and I also suspect that if they do exist you aren't
allowed to optimize these either.
In fact, the only difference I can think of between classes and
struct's in C++ I can think of is that the visibility is different by
default (private respective public). It's somewhat uncommon to see
advanced struct's (with member functions, and private struct parts),
but they are perfectly valid C++.
Return to the
Search the comp.compilers archives again.