46#ifndef _RWSTD_RW_SPECIALIZED_H_INCLUDED
47#define _RWSTD_RW_SPECIALIZED_H_INCLUDED
50#ifndef _RWSTD_RW_NEW_H_INCLUDED
55#ifndef _RWSTD_RW_ITERBASE_H_INCLUDED
63#ifndef _RWSTD_NO_NONDEDUCED_CONTEXT
64# define _RWSTD_CONTAINER_SIZE_TYPE typename _Container::size_type
66# define _RWSTD_CONTAINER_SIZE_TYPE _RWSTD_SIZE_T
71template <
class _Container>
80 const _RWSizeT __cap = (__size >> 10) * __ratio
81 + (((__size & 0x3ff) * __ratio) >> 10);
86#undef _RWSTD_CONTAINER_SIZE_TYPE
89#ifndef _RWSTD_NO_PART_SPEC_OVERLOAD
91template <
class _TypeT,
class _TypeU>
93__rw_construct (_TypeT* __p, _TypeU& __val)
99template <
class _TypeT,
class _TypeU>
101__rw_construct (
volatile _TypeT* __p, _TypeU& __val)
109template <
class _TypeT,
class _TypeU>
111__rw_construct_impl (_TypeT* __p, _TypeU& __val)
117template <
class _TypeT,
class _TypeU>
119__rw_construct (
volatile _TypeT* __p, _TypeU& __val)
127template <
class _TypeT>
129__rw_destroy (_TypeT &__ref)
135template <
class _ForwardIterator>
137__rw_destroy (_ForwardIterator __first, _ForwardIterator __last)
139 for (; __first != __last; ++__first)
140 __rw_destroy (*__first);
144#ifndef _RWSTD_NO_PTR_VALUE_TEMPLATE_OVERLOAD
147template <
class _TypeT>
148inline void __rw_destroy (_TypeT**, _TypeT**)
159template <
class _TypeT>
164template <
class _InputIterator,
class _ForwardIterator>
165inline _ForwardIterator
166uninitialized_copy (_InputIterator __first, _InputIterator __last,
167 _ForwardIterator __res)
169 const _ForwardIterator __start = __res;
170 typedef typename iterator_traits<_ForwardIterator>::value_type _TypeT;
173 for (; __first != __last; ++__first, ++__res) {
175 volatile void* __ptr =
181 _RW::__rw_destroy (__start, __res);
189#ifdef _RWSTD_ALLOCATOR
192template <
class _InputIterator,
class _ForwardIterator,
class _Allocator>
193inline _ForwardIterator
194uninitialized_copy (_InputIterator __first, _InputIterator __last,
195 _ForwardIterator __res, _Allocator &__alloc)
197 _ForwardIterator __start = __res;
200 for (; __first != __last; ++__first, ++__res)
201 __alloc.construct (__alloc.address (*__res), *__first);
204 for (; __start != __res; ++__start)
205 __alloc.destroy (__alloc.address (*__start));
216template <
class _ForwardIterator,
class _TypeT>
218uninitialized_fill (_ForwardIterator __first, _ForwardIterator __last,
221 const _ForwardIterator __start = __first;
224 for (; __first != __last; ++__first)
225 _RW::__rw_construct (&*__first, __x);
228 _RW::__rw_destroy (__start, __first);
235template <
class _ForwardIterator,
class _Size,
class _TypeT>
237uninitialized_fill_n (_ForwardIterator __first, _Size __n,
const _TypeT& __x)
239 const _ForwardIterator __start = __first;
242 for (; __n; --__n, ++__first)
243 _RW::__rw_construct (&*__first, __x);
246 _RW::__rw_destroy (__start, __first);
252#ifdef _RWSTD_ALLOCATOR
255template <
class _ForwardIter,
class _Size,
class _TypeT,
class _Allocator>
257uninitialized_fill_n (_ForwardIter __first, _Size __n,
258 const _TypeT& __x, _Allocator& __alloc)
260 _ForwardIter __start = __first;
263 for (; __n; --__n, ++__first)
264 __alloc.construct (__alloc.address (*__first), __x);
267 for (; __start != __first; ++__start)
268 __alloc.destroy (__alloc.address (*__start));
276template <
class _Allocator,
class _TypeT>
277class allocator_interface;
286template <
class _InputIterator,
class _ForwardIterator,
287 class _Allocator,
class _TypeT>
288inline _ForwardIterator
289uninitialized_copy (_InputIterator __first,
290 _InputIterator __last,
291 _ForwardIterator __res,
292 allocator_interface<_Allocator, _TypeT> &__alloc)
294 _ForwardIterator __start = __res;
297 for (; __first != __last; ++__first, ++__res)
298 __alloc.construct (__alloc.address (*__res), *__first);
301 for (; __start != __res; ++__start)
302 __alloc.destroy (__alloc.address (*__start));
309template <
class _ForwardIter,
class _Size,
310 class _TypeT,
class _Allocator,
class _TypeU>
312uninitialized_fill_n (_ForwardIter __first, _Size __n,
314 allocator_interface<_Allocator, _TypeU> &__alloc)
316 _ForwardIter __start = __first;
319 for (; __n; --__n, ++__first)
320 __alloc.construct (__alloc.address (*__first), __x);
323 for (; __start != __first; ++__start)
324 __alloc.destroy (__alloc.address (*__start));
#define _RWSTD_MINIMUM_NEW_CAPACITY
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_NEW_CAPACITY_RATIO
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_CONST_CAST(T, x)
#define _RWSTD_RATIO_DIVIDER
#define _RWSTD_CONTAINER_SIZE_TYPE