Patch for stl_vector.h and vector.tcc.

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Feb 13 19:40:00 GMT 2004


Felix Yen <fwy@alumni.brown.edu> writes:

| 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.

A given coding standard might make it a mistake.  It does not
necessarily follows it is an absolute mistake.  There are reasons why
someone may call its member function "clear" for zeroing  or clearinig
up a pool.

While I'm no going to do that in my code, it does not mean that the
library should be designed in a way that makes that liberty.

| Furthermore, I suspect that the compiler fails to optimize an empty
| base with a virtual method.

Such class cannot be an -empty- base, as defined by the ABI.
Therefore, yes you don't get that optimization.  But if the reason to
make the derivation is to take benefit of that optimization and that
optimization des not happen, then it is trumping.

-- Gaby



More information about the Libstdc++ mailing list