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: libstdc++/8230: Buggy allocator behaviour


On November 14, 2002 02:50 pm, Benjamin Kosnik wrote:
>
> >And _Alloc_type (should be __underlying_allocator or whatever) seems
> >superfluous.
>
> The points about a simpler way still seem true though.

There is a simpler way.  If the containers use their Allocator as a 
private base class instead of a member, the code is a lot cleaner.

I did a treatment of this and found, although the code looked cleaner 
to my eye, there was no significant advantage in terms of time or space 
(at least in 3.0, when I ran the tests).  I did not measure compile 
time differences.

I could try to dig up the treatment if you want an example of what I'm 
talking about.

The idea came from Matt Austern's article "What Are Allocators Good 
For?" (http://www.cuj.com/experts/1812/austern.htm?topic=experts).

-- 
Stephen M. Webb


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