This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for stl_vector.h and vector.tcc.


I should mention that I don't think the motive for this development is especially compelling. Defining an allocator with a method that conflicts with an STL container method seems like a mistake. Furthermore, I suspect that the compiler fails to optimize an empty base with a virtual method. On my Apple, gcc 3.3 (-O3) respectively produces class sizes 1, 4, 4, and 8 for the following:

struct empty {int f() {return 0;}};
struct virtually_empty {virtual int f() {return 0;}};
struct derived_from_empty : public empty {int baz;};
struct derived_from_virtually_empty : public virtually_empty {int baz;};

But Nathan's BaseOpt technique doesn't look that painful ...


Felix



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]