This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: default allocator templ arg for map and multimap
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Re: default allocator templ arg for map and multimap
- From: Nathan Myers <ncm at cantrip dot org>
- Date: Mon, 10 Apr 2000 05:25:29 -0700
- References: <200004100008.TAA20007@d0sgibnl1.fnal.gov>
- Reply-To: libstdc++ at sourceware dot cygnus dot com
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