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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Felix Yen <fwy at alumni dot brown dot edu>
- Cc: austern at apple dot com, libstdc++ at gcc dot gnu dot org
- Date: 13 Feb 2004 20:31:51 +0100
- Subject: Re: Patch for stl_vector.h and vector.tcc.
- Organization: Integrable Solutions
- References: <2BB4A043-5E51-11D8-99C4-0003931E0BB8@alumni.brown.edu>
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