Patch for stl_vector.h and vector.tcc.

Felix Yen fwy@alumni.brown.edu
Fri Feb 13 18:19:00 GMT 2004


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



More information about the Libstdc++ mailing list