1.1 --- a/epoc32/include/tools/stlport/stl/_alloc_old.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/tools/stlport/stl/_alloc_old.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,287 +1,287 @@
1.4 -template<class _Tp, class _Alloc>
1.5 -class __simple_alloc {
1.6 - typedef _Alloc __alloc_type;
1.7 -public:
1.8 - typedef typename _Alloc::value_type __alloc_value_type;
1.9 - typedef _Tp value_type;
1.10 - static size_t _STLP_CALL __chunk(size_t __n) {
1.11 - return (sizeof(__alloc_value_type)==sizeof(value_type)) ? __n :
1.12 - ((__n*sizeof(value_type)+sizeof(__alloc_value_type)-1)/sizeof(__alloc_value_type));
1.13 - }
1.14 - static _Tp* _STLP_CALL allocate(size_t __n) { return 0 == __n ? 0 : (_Tp*) __alloc_type::allocate(__chunk(__n)); }
1.15 - static void _STLP_CALL deallocate(_Tp * __p, size_t __n) {
1.16 - __alloc_type::deallocate((__alloc_value_type*)__p, __chunk(__n)); }
1.17 -};
1.18 -
1.19 -// Allocator adaptor to turn an SGI-style allocator (e.g. alloc, malloc_alloc)
1.20 -// into a standard-conforming allocator. Note that this adaptor does
1.21 -// *not* assume that all objects of the underlying alloc class are
1.22 -// identical, nor does it assume that all of the underlying alloc's
1.23 -// member functions are static member functions. Note, also, that
1.24 -// __allocator<_Tp, alloc> is essentially the same thing as allocator<_Tp>.
1.25 -
1.26 -template <class _Tp, class _Alloc>
1.27 -struct __allocator : public _Alloc {
1.28 - typedef _Alloc __underlying_alloc;
1.29 -
1.30 - typedef size_t size_type;
1.31 - typedef ptrdiff_t difference_type;
1.32 - typedef _Tp* pointer;
1.33 - typedef const _Tp* const_pointer;
1.34 - typedef _Tp& reference;
1.35 - typedef const _Tp& const_reference;
1.36 - typedef _Tp value_type;
1.37 -
1.38 -# if defined (_STLP_MEMBER_TEMPLATE_CLASSES)
1.39 - template <class _Tp1> struct rebind {
1.40 - typedef __allocator<_Tp1, _Alloc> other;
1.41 - };
1.42 -# endif
1.43 - __allocator() _STLP_NOTHROW {}
1.44 - __allocator(const _Alloc& ) _STLP_NOTHROW {}
1.45 - __allocator(const __allocator<_Tp, _Alloc>& __a) _STLP_NOTHROW
1.46 - : _Alloc(__a) {}
1.47 -# if defined (_STLP_MEMBER_TEMPLATES) && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
1.48 - template <class _Tp1>
1.49 - __allocator(const __allocator<_Tp1, _Alloc>& __a) _STLP_NOTHROW
1.50 - : _Alloc(__a) {}
1.51 -# endif
1.52 -# ifdef _STLP_TRIVIAL_DESTRUCTOR_BUG
1.53 - ~__allocator() _STLP_NOTHROW {}
1.54 -# endif
1.55 - pointer address(reference __x) const { return &__x; }
1.56 -
1.57 -# if !defined (__WATCOM_CPLUSPLUS__)
1.58 - const_pointer address(const_reference __x) const { return &__x; }
1.59 -# endif
1.60 -
1.61 - // __n is permitted to be 0.
1.62 - _Tp* allocate(size_type __n, const void* = 0) {
1.63 - if (__n > max_size())
1.64 - __THROW_BAD_ALLOC;
1.65 - return __n != 0
1.66 - ? __STATIC_CAST(_Tp*,__underlying_alloc::allocate(__n * sizeof(_Tp)))
1.67 - : 0;
1.68 - }
1.69 -
1.70 - // __p is not permitted to be a null pointer.
1.71 - void deallocate(pointer __p, size_type __n)
1.72 - { if (__p) __underlying_alloc::deallocate(__p, __n * sizeof(_Tp)); }
1.73 -
1.74 - size_type max_size() const _STLP_NOTHROW
1.75 - { return size_t(-1) / sizeof(_Tp); }
1.76 -
1.77 - void construct(pointer __p, const_reference __val) { _STLP_STD::_Copy_Construct(__p, __val); }
1.78 - void destroy(pointer __p) { _STLP_STD::_Destroy(__p); }
1.79 -
1.80 - const __underlying_alloc& __get_underlying_alloc() const { return *this; }
1.81 -};
1.82 -
1.83 -#ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION
1.84 -template <class _Alloc>
1.85 -class __allocator<void, _Alloc> {
1.86 - typedef size_t size_type;
1.87 - typedef ptrdiff_t difference_type;
1.88 - typedef void* pointer;
1.89 - typedef const void* const_pointer;
1.90 - typedef void value_type;
1.91 -#ifdef _STLP_MEMBER_TEMPLATE_CLASSES
1.92 - template <class _Tp1> struct rebind {
1.93 - typedef __allocator<_Tp1, _Alloc> other;
1.94 - };
1.95 -#endif
1.96 -};
1.97 -#endif
1.98 -
1.99 -template <class _Tp, class _Alloc>
1.100 -inline bool _STLP_CALL operator==(const __allocator<_Tp, _Alloc>& __a1,
1.101 - const __allocator<_Tp, _Alloc>& __a2)
1.102 -{
1.103 - return __a1.__get_underlying_alloc() == __a2.__get_underlying_alloc();
1.104 -}
1.105 -
1.106 -#ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.107 -template <class _Tp, class _Alloc>
1.108 -inline bool _STLP_CALL operator!=(const __allocator<_Tp, _Alloc>& __a1,
1.109 - const __allocator<_Tp, _Alloc>& __a2)
1.110 -{
1.111 - return __a1.__get_underlying_alloc() != __a2.__get_underlying_alloc();
1.112 -}
1.113 -#endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
1.114 -
1.115 -
1.116 -// Comparison operators for all of the predifined SGI-style allocators.
1.117 -// This ensures that __allocator<malloc_alloc> (for example) will
1.118 -// work correctly.
1.119 -
1.120 -#ifndef _STLP_NON_TYPE_TMPL_PARAM_BUG
1.121 -inline bool _STLP_CALL operator==(const __malloc_alloc&, const __malloc_alloc&)
1.122 -{ return true; }
1.123 -
1.124 -# ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER
1.125 -inline bool _STLP_CALL operator!=(const __malloc_alloc&, const __malloc_alloc&)
1.126 -{ return false; }
1.127 -# endif
1.128 -
1.129 -inline bool _STLP_CALL operator==(const __new_alloc&, const __new_alloc&) { return true; }
1.130 -
1.131 -# ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.132 -inline bool _STLP_CALL operator!=(const __new_alloc&, const __new_alloc&) { return false; }
1.133 -# endif
1.134 -
1.135 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.136 -inline bool _STLP_CALL operator==(const __node_alloc&,
1.137 - const __node_alloc&)
1.138 -{ return true; }
1.139 -
1.140 -# if defined( _STLP_FUNCTION_TMPL_PARTIAL_ORDER )
1.141 -
1.142 -inline bool _STLP_CALL operator!=(const __node_alloc&,
1.143 - const __node_alloc&)
1.144 -{ return false; }
1.145 -# endif
1.146 -# endif
1.147 -
1.148 -#endif /* _STLP_NON_TYPE_TMPL_PARAM_BUG */
1.149 -
1.150 -template <class _Alloc>
1.151 -inline bool _STLP_CALL operator==(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&) { return true; }
1.152 -# ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.153 -template <class _Alloc>
1.154 -inline bool _STLP_CALL operator!=(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&) { return false; }
1.155 -# endif
1.156 -
1.157 -#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
1.158 -
1.159 -// Versions for the predefined SGI-style allocators.
1.160 -template <class _Tp>
1.161 -struct _Alloc_traits<_Tp, __malloc_alloc> {
1.162 - typedef __allocator<_Tp, __malloc_alloc> allocator_type;
1.163 -};
1.164 -
1.165 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.166 -template <class _Tp>
1.167 -struct _Alloc_traits<_Tp, __node_alloc> {
1.168 - typedef __allocator<_Tp, __node_alloc> allocator_type;
1.169 -};
1.170 -# endif
1.171 -
1.172 -template <class _Tp, class _Alloc>
1.173 -struct _Alloc_traits<_Tp, __debug_alloc<_Alloc> > {
1.174 - typedef __allocator<_Tp, __debug_alloc<_Alloc> > allocator_type;
1.175 -};
1.176 -
1.177 -// Versions for the __allocator adaptor used with the predefined
1.178 -// SGI-style allocators.
1.179 -
1.180 -template <class _Tp, class _Tp1, class _Alloc>
1.181 -struct _Alloc_traits<_Tp, __allocator<_Tp1, _Alloc > > {
1.182 - typedef __allocator<_Tp, _Alloc > allocator_type;
1.183 -};
1.184 -
1.185 -#endif
1.186 -
1.187 -#if defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
1.188 -
1.189 -// Versions for the predefined SGI-style allocators.
1.190 -
1.191 -
1.192 -# if defined (_STLP_NON_TYPE_TMPL_PARAM_BUG)
1.193 -
1.194 -typedef __malloc_alloc __malloc_alloc_dfl;
1.195 -
1.196 -template <class _Tp>
1.197 -inline __allocator<_Tp, __malloc_alloc_dfl >& _STLP_CALL
1.198 -__stl_alloc_rebind(__malloc_alloc_dfl& __a, const _Tp*) {
1.199 - return (__allocator<_Tp, __malloc_alloc_dfl >&)__a;
1.200 -}
1.201 -
1.202 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.203 -template <class _Tp>
1.204 -inline __allocator<_Tp, __node_alloc>& _STLP_CALL
1.205 -__stl_alloc_rebind(__node_alloc& __a, const _Tp*) {
1.206 - return (__allocator<_Tp, __node_alloc>&)__a;
1.207 -}
1.208 -# endif
1.209 -
1.210 -template <class _Tp>
1.211 -inline __allocator<_Tp, __malloc_alloc_dfl > _STLP_CALL
1.212 -__stl_alloc_create(const __malloc_alloc_dfl&, const _Tp*) {
1.213 - return __allocator<_Tp, __malloc_alloc_dfl > ();
1.214 -}
1.215 -
1.216 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.217 -template <class _Tp>
1.218 -inline __allocator<_Tp, __node_alloc> _STLP_CALL
1.219 -__stl_alloc_create(const __node_alloc&, const _Tp*) {
1.220 - return __allocator<_Tp, __node_alloc>();
1.221 -}
1.222 -
1.223 -# endif
1.224 -
1.225 -# else
1.226 -
1.227 -template <class _Tp>
1.228 -inline __allocator<_Tp, __malloc_alloc>& _STLP_CALL
1.229 -__stl_alloc_rebind(__malloc_alloc& __a, const _Tp*) {
1.230 - return (__allocator<_Tp, __malloc_alloc>&)__a;
1.231 -}
1.232 -
1.233 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.234 -template <class _Tp>
1.235 -inline __allocator<_Tp, __node_alloc>& _STLP_CALL
1.236 -__stl_alloc_rebind(__node_alloc& __a, const _Tp*) {
1.237 - return (__allocator<_Tp, __node_alloc>&)__a;
1.238 -}
1.239 -# endif
1.240 -
1.241 -template <class _Tp>
1.242 -inline __allocator<_Tp, __malloc_alloc> _STLP_CALL
1.243 -__stl_alloc_create(const __malloc_alloc&, const _Tp*) {
1.244 - return __allocator<_Tp, __malloc_alloc>();
1.245 -}
1.246 -
1.247 -# if !defined (_STLP_USE_NO_IOSTREAMS)
1.248 -template <class _Tp>
1.249 -inline __allocator<_Tp, __node_alloc> _STLP_CALL
1.250 -__stl_alloc_create(const __node_alloc&, const _Tp*) {
1.251 - return __allocator<_Tp, __node_alloc>();
1.252 -}
1.253 -# endif
1.254 -
1.255 -# endif
1.256 -
1.257 -template <class _Tp, class _Alloc>
1.258 -inline __allocator<_Tp, __debug_alloc<_Alloc> > _STLP_CALL
1.259 -__stl_alloc_create(const __debug_alloc<_Alloc>&, const _Tp*) {
1.260 - return __allocator<_Tp, __debug_alloc<_Alloc> >();
1.261 -}
1.262 -template <class _Tp, class _Alloc>
1.263 -inline __allocator<_Tp, __debug_alloc<_Alloc> >& _STLP_CALL
1.264 -__stl_alloc_rebind(__debug_alloc<_Alloc>& __a, const _Tp*) {
1.265 - return (__allocator<_Tp, __debug_alloc<_Alloc> >&)__a;
1.266 -}
1.267 -
1.268 -template <class _Tp>
1.269 -inline __allocator<_Tp, __new_alloc > _STLP_CALL
1.270 -__stl_alloc_create(const __new_alloc&, const _Tp*) {
1.271 - return __allocator<_Tp, __new_alloc >();
1.272 -}
1.273 -template <class _Tp>
1.274 -inline __allocator<_Tp, __new_alloc >& _STLP_CALL
1.275 -__stl_alloc_rebind(__new_alloc& __a, const _Tp*) {
1.276 - return (__allocator<_Tp, __new_alloc >&)__a;
1.277 -}
1.278 -
1.279 -template <class _Tp1, class _Alloc, class _Tp2>
1.280 -inline __allocator<_Tp2, _Alloc>& _STLP_CALL
1.281 -__stl_alloc_rebind(__allocator<_Tp1, _Alloc>& __a, const _Tp2*) {
1.282 - return (__allocator<_Tp2, _Alloc>&)__a;
1.283 -}
1.284 -
1.285 -template <class _Tp1, class _Alloc, class _Tp2>
1.286 -inline __allocator<_Tp2, _Alloc> _STLP_CALL
1.287 -__stl_alloc_create(const __allocator<_Tp1, _Alloc>&, const _Tp2*) {
1.288 - return __allocator<_Tp2, _Alloc>();
1.289 -}
1.290 -#endif
1.291 +template<class _Tp, class _Alloc>
1.292 +class __simple_alloc {
1.293 + typedef _Alloc __alloc_type;
1.294 +public:
1.295 + typedef typename _Alloc::value_type __alloc_value_type;
1.296 + typedef _Tp value_type;
1.297 + static size_t _STLP_CALL __chunk(size_t __n) {
1.298 + return (sizeof(__alloc_value_type)==sizeof(value_type)) ? __n :
1.299 + ((__n*sizeof(value_type)+sizeof(__alloc_value_type)-1)/sizeof(__alloc_value_type));
1.300 + }
1.301 + static _Tp* _STLP_CALL allocate(size_t __n) { return 0 == __n ? 0 : (_Tp*) __alloc_type::allocate(__chunk(__n)); }
1.302 + static void _STLP_CALL deallocate(_Tp * __p, size_t __n) {
1.303 + __alloc_type::deallocate((__alloc_value_type*)__p, __chunk(__n)); }
1.304 +};
1.305 +
1.306 +// Allocator adaptor to turn an SGI-style allocator (e.g. alloc, malloc_alloc)
1.307 +// into a standard-conforming allocator. Note that this adaptor does
1.308 +// *not* assume that all objects of the underlying alloc class are
1.309 +// identical, nor does it assume that all of the underlying alloc's
1.310 +// member functions are static member functions. Note, also, that
1.311 +// __allocator<_Tp, alloc> is essentially the same thing as allocator<_Tp>.
1.312 +
1.313 +template <class _Tp, class _Alloc>
1.314 +struct __allocator : public _Alloc {
1.315 + typedef _Alloc __underlying_alloc;
1.316 +
1.317 + typedef size_t size_type;
1.318 + typedef ptrdiff_t difference_type;
1.319 + typedef _Tp* pointer;
1.320 + typedef const _Tp* const_pointer;
1.321 + typedef _Tp& reference;
1.322 + typedef const _Tp& const_reference;
1.323 + typedef _Tp value_type;
1.324 +
1.325 +# if defined (_STLP_MEMBER_TEMPLATE_CLASSES)
1.326 + template <class _Tp1> struct rebind {
1.327 + typedef __allocator<_Tp1, _Alloc> other;
1.328 + };
1.329 +# endif
1.330 + __allocator() _STLP_NOTHROW {}
1.331 + __allocator(const _Alloc& ) _STLP_NOTHROW {}
1.332 + __allocator(const __allocator<_Tp, _Alloc>& __a) _STLP_NOTHROW
1.333 + : _Alloc(__a) {}
1.334 +# if defined (_STLP_MEMBER_TEMPLATES) && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
1.335 + template <class _Tp1>
1.336 + __allocator(const __allocator<_Tp1, _Alloc>& __a) _STLP_NOTHROW
1.337 + : _Alloc(__a) {}
1.338 +# endif
1.339 +# ifdef _STLP_TRIVIAL_DESTRUCTOR_BUG
1.340 + ~__allocator() _STLP_NOTHROW {}
1.341 +# endif
1.342 + pointer address(reference __x) const { return &__x; }
1.343 +
1.344 +# if !defined (__WATCOM_CPLUSPLUS__)
1.345 + const_pointer address(const_reference __x) const { return &__x; }
1.346 +# endif
1.347 +
1.348 + // __n is permitted to be 0.
1.349 + _Tp* allocate(size_type __n, const void* = 0) {
1.350 + if (__n > max_size())
1.351 + __THROW_BAD_ALLOC;
1.352 + return __n != 0
1.353 + ? __STATIC_CAST(_Tp*,__underlying_alloc::allocate(__n * sizeof(_Tp)))
1.354 + : 0;
1.355 + }
1.356 +
1.357 + // __p is not permitted to be a null pointer.
1.358 + void deallocate(pointer __p, size_type __n)
1.359 + { if (__p) __underlying_alloc::deallocate(__p, __n * sizeof(_Tp)); }
1.360 +
1.361 + size_type max_size() const _STLP_NOTHROW
1.362 + { return size_t(-1) / sizeof(_Tp); }
1.363 +
1.364 + void construct(pointer __p, const_reference __val) { _STLP_STD::_Copy_Construct(__p, __val); }
1.365 + void destroy(pointer __p) { _STLP_STD::_Destroy(__p); }
1.366 +
1.367 + const __underlying_alloc& __get_underlying_alloc() const { return *this; }
1.368 +};
1.369 +
1.370 +#ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION
1.371 +template <class _Alloc>
1.372 +class __allocator<void, _Alloc> {
1.373 + typedef size_t size_type;
1.374 + typedef ptrdiff_t difference_type;
1.375 + typedef void* pointer;
1.376 + typedef const void* const_pointer;
1.377 + typedef void value_type;
1.378 +#ifdef _STLP_MEMBER_TEMPLATE_CLASSES
1.379 + template <class _Tp1> struct rebind {
1.380 + typedef __allocator<_Tp1, _Alloc> other;
1.381 + };
1.382 +#endif
1.383 +};
1.384 +#endif
1.385 +
1.386 +template <class _Tp, class _Alloc>
1.387 +inline bool _STLP_CALL operator==(const __allocator<_Tp, _Alloc>& __a1,
1.388 + const __allocator<_Tp, _Alloc>& __a2)
1.389 +{
1.390 + return __a1.__get_underlying_alloc() == __a2.__get_underlying_alloc();
1.391 +}
1.392 +
1.393 +#ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.394 +template <class _Tp, class _Alloc>
1.395 +inline bool _STLP_CALL operator!=(const __allocator<_Tp, _Alloc>& __a1,
1.396 + const __allocator<_Tp, _Alloc>& __a2)
1.397 +{
1.398 + return __a1.__get_underlying_alloc() != __a2.__get_underlying_alloc();
1.399 +}
1.400 +#endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
1.401 +
1.402 +
1.403 +// Comparison operators for all of the predifined SGI-style allocators.
1.404 +// This ensures that __allocator<malloc_alloc> (for example) will
1.405 +// work correctly.
1.406 +
1.407 +#ifndef _STLP_NON_TYPE_TMPL_PARAM_BUG
1.408 +inline bool _STLP_CALL operator==(const __malloc_alloc&, const __malloc_alloc&)
1.409 +{ return true; }
1.410 +
1.411 +# ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER
1.412 +inline bool _STLP_CALL operator!=(const __malloc_alloc&, const __malloc_alloc&)
1.413 +{ return false; }
1.414 +# endif
1.415 +
1.416 +inline bool _STLP_CALL operator==(const __new_alloc&, const __new_alloc&) { return true; }
1.417 +
1.418 +# ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.419 +inline bool _STLP_CALL operator!=(const __new_alloc&, const __new_alloc&) { return false; }
1.420 +# endif
1.421 +
1.422 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.423 +inline bool _STLP_CALL operator==(const __node_alloc&,
1.424 + const __node_alloc&)
1.425 +{ return true; }
1.426 +
1.427 +# if defined( _STLP_FUNCTION_TMPL_PARTIAL_ORDER )
1.428 +
1.429 +inline bool _STLP_CALL operator!=(const __node_alloc&,
1.430 + const __node_alloc&)
1.431 +{ return false; }
1.432 +# endif
1.433 +# endif
1.434 +
1.435 +#endif /* _STLP_NON_TYPE_TMPL_PARAM_BUG */
1.436 +
1.437 +template <class _Alloc>
1.438 +inline bool _STLP_CALL operator==(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&) { return true; }
1.439 +# ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.440 +template <class _Alloc>
1.441 +inline bool _STLP_CALL operator!=(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&) { return false; }
1.442 +# endif
1.443 +
1.444 +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
1.445 +
1.446 +// Versions for the predefined SGI-style allocators.
1.447 +template <class _Tp>
1.448 +struct _Alloc_traits<_Tp, __malloc_alloc> {
1.449 + typedef __allocator<_Tp, __malloc_alloc> allocator_type;
1.450 +};
1.451 +
1.452 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.453 +template <class _Tp>
1.454 +struct _Alloc_traits<_Tp, __node_alloc> {
1.455 + typedef __allocator<_Tp, __node_alloc> allocator_type;
1.456 +};
1.457 +# endif
1.458 +
1.459 +template <class _Tp, class _Alloc>
1.460 +struct _Alloc_traits<_Tp, __debug_alloc<_Alloc> > {
1.461 + typedef __allocator<_Tp, __debug_alloc<_Alloc> > allocator_type;
1.462 +};
1.463 +
1.464 +// Versions for the __allocator adaptor used with the predefined
1.465 +// SGI-style allocators.
1.466 +
1.467 +template <class _Tp, class _Tp1, class _Alloc>
1.468 +struct _Alloc_traits<_Tp, __allocator<_Tp1, _Alloc > > {
1.469 + typedef __allocator<_Tp, _Alloc > allocator_type;
1.470 +};
1.471 +
1.472 +#endif
1.473 +
1.474 +#if defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
1.475 +
1.476 +// Versions for the predefined SGI-style allocators.
1.477 +
1.478 +
1.479 +# if defined (_STLP_NON_TYPE_TMPL_PARAM_BUG)
1.480 +
1.481 +typedef __malloc_alloc __malloc_alloc_dfl;
1.482 +
1.483 +template <class _Tp>
1.484 +inline __allocator<_Tp, __malloc_alloc_dfl >& _STLP_CALL
1.485 +__stl_alloc_rebind(__malloc_alloc_dfl& __a, const _Tp*) {
1.486 + return (__allocator<_Tp, __malloc_alloc_dfl >&)__a;
1.487 +}
1.488 +
1.489 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.490 +template <class _Tp>
1.491 +inline __allocator<_Tp, __node_alloc>& _STLP_CALL
1.492 +__stl_alloc_rebind(__node_alloc& __a, const _Tp*) {
1.493 + return (__allocator<_Tp, __node_alloc>&)__a;
1.494 +}
1.495 +# endif
1.496 +
1.497 +template <class _Tp>
1.498 +inline __allocator<_Tp, __malloc_alloc_dfl > _STLP_CALL
1.499 +__stl_alloc_create(const __malloc_alloc_dfl&, const _Tp*) {
1.500 + return __allocator<_Tp, __malloc_alloc_dfl > ();
1.501 +}
1.502 +
1.503 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.504 +template <class _Tp>
1.505 +inline __allocator<_Tp, __node_alloc> _STLP_CALL
1.506 +__stl_alloc_create(const __node_alloc&, const _Tp*) {
1.507 + return __allocator<_Tp, __node_alloc>();
1.508 +}
1.509 +
1.510 +# endif
1.511 +
1.512 +# else
1.513 +
1.514 +template <class _Tp>
1.515 +inline __allocator<_Tp, __malloc_alloc>& _STLP_CALL
1.516 +__stl_alloc_rebind(__malloc_alloc& __a, const _Tp*) {
1.517 + return (__allocator<_Tp, __malloc_alloc>&)__a;
1.518 +}
1.519 +
1.520 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.521 +template <class _Tp>
1.522 +inline __allocator<_Tp, __node_alloc>& _STLP_CALL
1.523 +__stl_alloc_rebind(__node_alloc& __a, const _Tp*) {
1.524 + return (__allocator<_Tp, __node_alloc>&)__a;
1.525 +}
1.526 +# endif
1.527 +
1.528 +template <class _Tp>
1.529 +inline __allocator<_Tp, __malloc_alloc> _STLP_CALL
1.530 +__stl_alloc_create(const __malloc_alloc&, const _Tp*) {
1.531 + return __allocator<_Tp, __malloc_alloc>();
1.532 +}
1.533 +
1.534 +# if !defined (_STLP_USE_NO_IOSTREAMS)
1.535 +template <class _Tp>
1.536 +inline __allocator<_Tp, __node_alloc> _STLP_CALL
1.537 +__stl_alloc_create(const __node_alloc&, const _Tp*) {
1.538 + return __allocator<_Tp, __node_alloc>();
1.539 +}
1.540 +# endif
1.541 +
1.542 +# endif
1.543 +
1.544 +template <class _Tp, class _Alloc>
1.545 +inline __allocator<_Tp, __debug_alloc<_Alloc> > _STLP_CALL
1.546 +__stl_alloc_create(const __debug_alloc<_Alloc>&, const _Tp*) {
1.547 + return __allocator<_Tp, __debug_alloc<_Alloc> >();
1.548 +}
1.549 +template <class _Tp, class _Alloc>
1.550 +inline __allocator<_Tp, __debug_alloc<_Alloc> >& _STLP_CALL
1.551 +__stl_alloc_rebind(__debug_alloc<_Alloc>& __a, const _Tp*) {
1.552 + return (__allocator<_Tp, __debug_alloc<_Alloc> >&)__a;
1.553 +}
1.554 +
1.555 +template <class _Tp>
1.556 +inline __allocator<_Tp, __new_alloc > _STLP_CALL
1.557 +__stl_alloc_create(const __new_alloc&, const _Tp*) {
1.558 + return __allocator<_Tp, __new_alloc >();
1.559 +}
1.560 +template <class _Tp>
1.561 +inline __allocator<_Tp, __new_alloc >& _STLP_CALL
1.562 +__stl_alloc_rebind(__new_alloc& __a, const _Tp*) {
1.563 + return (__allocator<_Tp, __new_alloc >&)__a;
1.564 +}
1.565 +
1.566 +template <class _Tp1, class _Alloc, class _Tp2>
1.567 +inline __allocator<_Tp2, _Alloc>& _STLP_CALL
1.568 +__stl_alloc_rebind(__allocator<_Tp1, _Alloc>& __a, const _Tp2*) {
1.569 + return (__allocator<_Tp2, _Alloc>&)__a;
1.570 +}
1.571 +
1.572 +template <class _Tp1, class _Alloc, class _Tp2>
1.573 +inline __allocator<_Tp2, _Alloc> _STLP_CALL
1.574 +__stl_alloc_create(const __allocator<_Tp1, _Alloc>&, const _Tp2*) {
1.575 + return __allocator<_Tp2, _Alloc>();
1.576 +}
1.577 +#endif