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: default allocator templ arg for map and multimap


On Sun, Apr 09, 2000 at 07:08:26PM -0500, scott snyder wrote:
> I noticed recently that one of the default template arguments for the
> map and multimap classes in libstdc++ do not agree with the standard.
> ... according to the standard it should be:
> 
>   template <class _Key, class _Tp, class _Compare = less<_Key>,
>             class _Alloc = allocator<pair<const _Key, _Tp> > >
>   class map;
> 
> I'm not sending a patch for this at this time because i ran into a bit
> of a technical problem trying to fix this.  What's actually in the code
> is not the above, but instead:
> 
> #ifndef __STL_LIMITED_DEFAULT_TEMPLATES
> template <class _Key, class _Tp, class _Compare = less<_Key>,
>           class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
> #else
> template <class _Key, class _Tp, class _Compare,
>           class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
> #endif
> class map {

The __STL_DEFAULT_ALLOCATOR macro is an obsolete compabitility
hack.  Please do submit a patch without it, and without the
__STL_LIMITED_DEFAULT_TEMPLATES hack either.

(For extra credit, eliminate both from all declarations -- but don't
hold up the fix on that account.)

Nathan Myers
ncm@cantrip.org


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