This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

Re: allocator_type typedef/typename ?




On Sun, 12 Dec 1999, Yotam Medini wrote:

> 
> Shouldn't an STL container  Cntr  have  Cntr<...>::allocator_type
> defined as a typename.

I think so. It is mentioned in the standard. (23.2.1)

> 
> For example SGI's deque has:
>    // {
>    template <class T, class Alloc = alloc, size_t BufSiz = 0> 
>    class deque {
>    ...
>      typedef simple_alloc<pointer, Alloc> map_allocator;
>      typedef simple_alloc<value_type, Alloc> data_allocator;
>    ...
>    };
>    // }
> But no  'allocator_type'  definition as suggested by
>    http://www.dinkumware.com/htm_cpl/deque.html#deque
> 
> -- yotam
> 

Well, I don't have SGI's STL, but libstdc++-v3 (from cvs) certainly has
  dequeue<...>::allocator_type . I didn't look at the other containers,
  but I would assume they have have Container<..>::allocator_type .


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