This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++/8230: Buggy allocator behaviour
- From: Stephen M. Webb <stephen dot webb at bregmasoft dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 14 Nov 2002 15:50:44 -0500
- Subject: Re: libstdc++/8230: Buggy allocator behaviour
- Organization: Bregmasoft
- References: <20021113221911.21632.qmail@sources.redhat.com> <20021114134401.0ec0e70b.bkoz@redhat.com> <20021114135013.11819293.bkoz@redhat.com>
- Reply-to: stephen dot webb at bregmasoft dot com
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