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.


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


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