This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Patch for stl_vector.h and vector.tcc.
- From: Felix Yen <fwy at alumni dot brown dot edu>
- To: austern at apple dot com
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 13 Feb 2004 13:19:32 -0500
- Subject: 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