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



>could you tell me the reason for the two const in the map and multimap :
>_Alloc = allocator<pair<const _Key, const _Tp> > >
>isntead of 
>_Alloc = allocator<pair<const _Key, _Tp> > >

Here's a revised patch which should fix that.

thanks,
sss



2000-04-12  scott snyder  <snyder@fnal.gov>

	* stl/bits/stl_map.h (class map): Fix default for _Alloc template
	parameter.  Get rid of use of __STL_DEFAULT_ALLOCATOR and
	__STL_LIMITED_DEFAULT_TEMPLATES macros.
	* stl/bits/stl_multimap.h (class multimap): Likewise.  Get rid of
	use of __STL_DEPENDENT_DEFAULT_TMPL macro.


Index: stl/bits/stl_map.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/stl/bits/stl_map.h,v
retrieving revision 1.7
diff -u -p -r1.7 stl_map.h
--- stl_map.h	1999/05/05 00:39:22	1.7
+++ stl_map.h	2000/04/13 04:47:38
@@ -38,13 +38,8 @@ __STL_BEGIN_NAMESPACE
 #pragma set woff 1375
 #endif
 
-#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 _Alloc = allocator<pair<const _Key, _Tp> > >
 class map {
 public:
 
Index: stl/bits/stl_multimap.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/stl/bits/stl_multimap.h,v
retrieving revision 1.8
diff -u -p -r1.8 stl_multimap.h
--- stl_multimap.h	1999/05/05 00:39:23	1.8
+++ stl_multimap.h	2000/04/13 04:47:38
@@ -41,8 +41,8 @@ __STL_BEGIN_NAMESPACE
 // Forward declaration of operators < and ==, needed for friend declaration.
 
 template <class _Key, class _Tp, 
-          class _Compare __STL_DEPENDENT_DEFAULT_TMPL(less<_Key>),
-          class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
+          class _Compare = less<_Key>,
+          class _Alloc = allocator<pair<const _Key, _Tp> > >
 class multimap;
 
 template <class _Key, class _Tp, class _Compare, class _Alloc>

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