Re: allocator requirements
From: Jonathan Turkanis (technews_at_kangaroologic.com)
Date: 07/09/04
- Next message: Howard: "Re: help: class compile error"
- Previous message: Joe Laughlin: "Re: New"
- In reply to: John Harrison: "Re: allocator requirements"
- Next in thread: John Harrison: "Re: allocator requirements"
- Reply: John Harrison: "Re: allocator requirements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 9 Jul 2004 15:21:25 -0600
"John Harrison" <john_andronicus@hotmail.com> wrote in message
news:opsav1xfa5212331@andronicus...
> On Fri, 09 Jul 2004 20:47:16 GMT, P.J. Plauger <pjp@dinkumware.com>
wrote:
>
> > "John Harrison" <john_andronicus@hotmail.com> wrote in message
> > news:opsavy7sdb212331@andronicus...
> >
> >> If you specify an allocator in an STL container is it a
requirement that
> >> the allocator allocates object of the right type,
> >
> > Yes, according to the C++ Standard.
> >
> >> or can you
assume that
> >> the container will rebind the allocator to the correct type?
> >
> > Yes, according to widespread practice.
> >
> > P.J. Plauger
> > Dinkumware, Ltd.
> > http://www.dinkumware.com
> >
>
> Yes it seems so, both implementations of the STL I've checked do
rebind
> the allocator for vector at least. This seems to directly contradict
the
> requirements for allocator_type.
How does this contradict the allocator requirements?
> I also noticed that Josuttis' book also ignores what the standard
says,
> see first page of chapter 15 where he happily passes the same
allocator to
> several containers with different value types.
It looks to me like the allocators he uses all have value_types
appropriate for the containers.
Jonathan
- Next message: Howard: "Re: help: class compile error"
- Previous message: Joe Laughlin: "Re: New"
- In reply to: John Harrison: "Re: allocator requirements"
- Next in thread: John Harrison: "Re: allocator requirements"
- Reply: John Harrison: "Re: allocator requirements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|