30#ifndef _STLP_INTERNAL_VECTOR_H
31#define _STLP_INTERNAL_VECTOR_H
33#ifndef _STLP_INTERNAL_ALGOBASE_H
37#ifndef _STLP_INTERNAL_ALLOC_H
41#ifndef _STLP_INTERNAL_ITERATOR_H
45#ifndef _STLP_INTERNAL_UNINITIALIZED_H
57template <
class _Tp,
class _Alloc>
77#if !defined (_STLP_NO_MOVE_SEMANTIC)
82 src.get()._M_finish =
src.get()._M_end_of_storage.
_M_data =
src.get()._M_start = 0;
100#if defined (_STLP_USE_PTR_SPECIALIZATIONS)
101# define vector _STLP_PTR_IMPL_NAME(vector)
102#elif defined (_STLP_DEBUG)
103# define vector _STLP_NON_DBG_NAME(vector)
108template <
class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
110#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (vector)
139#if defined (_STLP_NO_MOVE_SEMANTIC)
158 size_type __fill_len,
bool __atend =
false) {
159#if !defined (_STLP_NO_MOVE_SEMANTIC)
165 size_type __fill_len,
bool __atend =
false);
168 this->_M_throw_out_of_range();
174 this->_M_throw_length_error();
176 if (__len >
max_size() || __len < __size)
188 const_reverse_iterator
rbegin()
const {
return const_reverse_iterator(
end()); }
190 const_reverse_iterator
rend()
const {
return const_reverse_iterator(
begin()); }
195 typename allocator_type::size_type __alloc_max_size = this->_M_end_of_storage.max_size();
196 return (__alloc_max_size < __vector_max_size)?__alloc_max_size:__vector_max_size;
200 bool empty()
const {
return this->_M_start == this->_M_finish; }
213 _Tp*
data() {
return this->_M_start; }
214 const _Tp*
data()
const {
return this->_M_start; }
216#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
225#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
255#if !defined (_STLP_NO_MOVE_SEMANTIC)
261#if defined (_STLP_MEMBER_TEMPLATES)
263 template <
class _Integer>
264 void _M_initialize_aux(_Integer
__n, _Integer
__val,
267 this->_M_start = this->_M_end_of_storage.allocate(
__n, __real_n);
268 this->_M_end_of_storage._M_data = this->_M_start + __real_n;
272 template <
class _InputIterator>
273 void _M_initialize_aux(_InputIterator __first, _InputIterator
__last,
279 template <
class _InputIterator>
284 _M_initialize_aux(__first,
__last, _Integral());
287# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
288 template <
class _InputIterator>
292 _M_initialize_aux(__first,
__last, _Integral());
321#if defined (_STLP_MEMBER_TEMPLATES)
322 template <
class _ForwardIter>
333 _M_set(__tmp, __tmp + __len, __tmp +
__n);
335 else if (
size() >= __len) {
337 _STLP_STD::_Destroy_Range(__new_finish, this->_M_finish);
338 this->_M_finish = __new_finish;
341 _ForwardIter __mid = __first;
342 _STLP_STD::advance(__mid,
size());
343 _STLP_STD::copy(__first, __mid, this->_M_start);
344 this->_M_finish = _STLP_STD::uninitialized_copy(__mid,
__last, this->_M_finish);
348#if defined (_STLP_MEMBER_TEMPLATES)
349 template <
class _InputIter>
350 void _M_assign_aux(_InputIter __first, _InputIter
__last,
353 for ( ; __first !=
__last && __cur !=
end(); ++__cur, ++__first)
361 template <
class _Integer>
362 void _M_assign_dispatch(_Integer
__n, _Integer
__val,
366 template <
class _InputIter>
367 void _M_assign_dispatch(_InputIter __first, _InputIter
__last,
371 template <
class _InputIterator>
372 void assign(_InputIterator __first, _InputIterator
__last) {
374 _M_assign_dispatch(__first,
__last, _Integral());
378#if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
383 if (this->_M_finish != this->_M_end_of_storage._M_data) {
393#if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
399#if defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
405 _STLP_STD::swap(this->_M_start, __x._M_start);
406 _STLP_STD::swap(this->_M_finish, __x._M_finish);
407 this->_M_end_of_storage.swap(__x._M_end_of_storage);
409#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
410 void _M_swap_workaround(
_Self& __x) {
swap(__x); }
419 return (&__x >= this->_M_start && &__x < this->_M_finish);
422#if defined (_STLP_MEMBER_TEMPLATES)
423 template <
class _ForwardIterator>
425 _ForwardIterator __first, _ForwardIterator
__last,
432#if !defined (_STLP_NO_MOVE_SEMANTIC)
436 pointer __new_start = this->_M_end_of_storage.allocate(__len, __len);
437 pointer __new_finish = __new_start;
443 _STLP_UNWIND((_STLP_STD::_Destroy_Range(__new_start,__new_finish),
444 this->_M_end_of_storage.deallocate(__new_start,__len)))
446 _M_set(__new_start, __new_finish, __new_start + __len);
449#if defined (_STLP_MEMBER_TEMPLATES)
450 template <
class _ForwardIterator>
452 _ForwardIterator __first, _ForwardIterator
__last,
458 iterator __src = this->_M_finish - 1;
460 for (; __src >= __pos; --__dst, --__src) {
461 _STLP_STD::_Move_Construct(__dst, *__src);
462 _STLP_STD::_Destroy_Moved(__src);
465 this->_M_finish +=
__n;
468#if defined (_STLP_MEMBER_TEMPLATES)
469 template <
class _ForwardIterator>
471 _ForwardIterator __first, _ForwardIterator
__last,
479 const size_type __elems_after = this->_M_finish - __pos;
480 pointer __old_finish = this->_M_finish;
481 if (__elems_after >
__n) {
483 this->_M_finish +=
__n;
488#if defined ( _STLP_MEMBER_TEMPLATES )
489 _ForwardIterator __mid = __first;
490 _STLP_STD::advance(__mid, __elems_after);
495 this->_M_finish +=
__n - __elems_after;
497 this->_M_finish += __elems_after;
498 copy(__first, __mid, __pos);
503#if defined (_STLP_MEMBER_TEMPLATES)
504 template <
class _Integer>
509 template <
class _InputIterator>
510 void _M_insert_dispatch(
iterator __pos,
511 _InputIterator __first, _InputIterator
__last,
517 template <
class _InputIterator>
520 _M_insert_dispatch(__pos, __first,
__last, _Integral());
524 template <
class _InputIterator>
525 void _M_range_insert(
iterator __pos,
526 _InputIterator __first, _InputIterator
__last,
528 for ( ; __first !=
__last; ++__first) {
529 __pos =
insert(__pos, *__first);
534 template <
class _ForwardIterator>
535 void _M_range_insert(
iterator __pos,
536 _ForwardIterator __first, _ForwardIterator
__last,
543#if !defined (_STLP_NO_MOVE_SEMANTIC)
552 if (
size_type(this->_M_end_of_storage._M_data - this->_M_finish) >=
__n) {
567 _STLP_STD::_Destroy(this->_M_finish);
572 _STLP_STD::_Destroy(__pos);
573 iterator __dst = __pos, __src = __dst + 1;
575 for (; __src != __end; ++__dst, ++__src) {
576 _STLP_STD::_Move_Construct(__dst, *__src);
577 _STLP_STD::_Destroy_Moved(__src);
579 this->_M_finish = __dst;
583 if (__pos + 1 !=
end()) {
588 _STLP_STD::_Destroy(this->_M_finish);
594 for (; __dst !=
__last && __src != __end; ++__dst, ++__src) {
595 _STLP_STD::_Destroy(__dst);
596 _STLP_STD::_Move_Construct(__dst, *__src);
600 _STLP_STD::_Destroy_Range(__dst,
__last);
601 _STLP_STD::_Destroy_Moved_Range(
__last, __end);
605 for (; __src != __end; ++__dst, ++__src) {
606 _STLP_STD::_Destroy_Moved(__dst);
607 _STLP_STD::_Move_Construct(__dst, *__src);
609 _STLP_STD::_Destroy_Moved_Range(__dst, __end);
611 this->_M_finish = __dst;
617 _STLP_STD::_Destroy_Range(__i, this->_M_finish);
618 this->_M_finish = __i;
624#if !defined (_STLP_NO_MOVE_SEMANTIC)
630#if !defined (_STLP_NO_MOVE_SEMANTIC)
638#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
643 if (__new_size <
size())
649#if defined (_STLP_DONT_SUP_DFLT_PARAM)
660 this->_M_end_of_storage.deallocate(this->_M_start, this->_M_end_of_storage._M_data - this->_M_start);
664 _STLP_STD::_Destroy_Moved_Range(
rbegin(),
rend());
665 this->_M_end_of_storage.deallocate(this->_M_start, this->_M_end_of_storage._M_data - this->_M_start);
669 this->_M_start = __s;
670 this->_M_finish = __f;
671 this->_M_end_of_storage._M_data = __e;
674#if defined (_STLP_MEMBER_TEMPLATES)
675 template <
class _ForwardIterator>
677 _ForwardIterator __first, _ForwardIterator
__last)
683 pointer __result = this->_M_end_of_storage.allocate(
__n,
__n);
693#if defined (_STLP_MEMBER_TEMPLATES)
694 template <
class _InputIterator>
695 void _M_range_initialize(_InputIterator __first, _InputIterator
__last,
697 for ( ; __first !=
__last; ++__first)
701 template <
class _ForwardIterator>
702 void _M_range_initialize(_ForwardIterator __first, _ForwardIterator
__last,
705 this->_M_start = this->_M_end_of_storage.allocate(
__n,
__n);
706 this->_M_end_of_storage._M_data = this->_M_start +
__n;
719#if !defined (_STLP_LINK_TIME_INSTANTIATION)
723#if defined (_STLP_USE_PTR_SPECIALIZATIONS)
730#if !defined (_STLP_NO_BOOL) || !defined (_STLP_NO_EXTENSIONS)
731# if !defined (_STLP_INTERNAL_BVECTOR_H)
736#if defined (_STLP_DEBUG)
742#if !defined (_STLP_NO_BOOL) && !defined (_STLP_NO_EXTENSIONS)
747#define _STLP_TEMPLATE_HEADER template <class _Tp, class _Alloc>
748#define _STLP_TEMPLATE_CONTAINER vector<_Tp, _Alloc>
750#undef _STLP_TEMPLATE_CONTAINER
751#undef _STLP_TEMPLATE_HEADER
753#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
754# if !defined (_STLP_NO_MOVE_SEMANTIC)
755template <
class _Tp,
class _Alloc>
762# if !defined (_STLP_DEBUG)
763template <
class _Tp,
class _Alloc>
_STLP_INLINE_LOOP _InputIter __last
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
_OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
_STLP_INLINE_LOOP _InputIter const _Tp & __val
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
#define _STLP_FORCE_ALLOCATORS(a, y)
#define _STLP_MPWFIX_CATCH
void _Copy_Construct(_Tp *__p, const _Tp &__val)
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_OutputIter __ucopy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
_ForwardIter __uninitialized_init(_ForwardIter __first, _Size __n, const _Tp &__val)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
_ForwardIter __uninitialized_move(_InputIter __first, _InputIter __last, _ForwardIter __result, _TrivialUCpy __trivial_ucpy, const __false_type &)
_ForwardIter __uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp &__x)
_STLP_END_NAMESPACE _STLP_BEGIN_NAMESPACE typedef vector< bool, allocator< bool > > bit_vector
void get(int argc, const char *argv[])
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
_Tp * allocate(size_type __n, size_type &__allocated_n)
void _STLP_FUNCTION_THROWS _M_throw_length_error() const
_Vector_base< _Tp, _Alloc > _Self
_AllocProxy _M_end_of_storage
_Vector_base(size_t __n, const _Alloc &__a)
void _STLP_FUNCTION_THROWS _M_throw_out_of_range() const
_Vector_base(__move_source< _Self > src)
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_UNWIND(action)
#define _STLP_RET_AFTER_THROW(data)
#define _STLP_FUNCTION_THROWS
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_ALLOCATOR_TYPE_DFL
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
GLsizei const GLvoid * pointer
iterator erase(iterator __pos)
void _M_fill_insert(iterator __pos, size_type __n, const _Tp &__x)
iterator _M_erase(iterator __pos, const __true_type &)
void _M_insert_overflow_aux(pointer __pos, const _Tp &__x, const __false_type &, size_type __fill_len, bool __atend)
const_iterator begin() const
iterator _M_erase(iterator __pos, const __false_type &)
void reserve(size_type __n)
void _M_initialize(size_type __n, const _Tp &__val=_STLP_DEFAULT_CONSTRUCTED(_Tp))
const_iterator end() const
void assign(const_iterator __first, const_iterator __last)
const value_type * const_pointer
void _M_set(pointer __s, pointer __f, pointer __e)
void insert(iterator __pos, const_iterator __first, const_iterator __last)
void _M_insert_overflow(pointer __pos, const _Tp &__x, const __false_type &, size_type __fill_len, bool __atend=false)
vector(size_type __n, const _Tp &__val, const allocator_type &__a=allocator_type())
reverse_iterator rbegin()
size_type max_size() const
void _M_range_insert_aux(iterator __pos, const_iterator __first, const_iterator __last, size_type __n, const __false_type &)
vector(__move_source< _Self > src)
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
bool _M_is_inside(const value_type &__x) const
size_type capacity() const
void resize(size_type __new_size, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
_Self & operator=(const _Self &__x)
reference operator[](size_type __n)
size_type _M_compute_next_size(size_type __n)
_Base::allocator_type allocator_type
vector(const allocator_type &__a=allocator_type())
iterator _M_erase(iterator __first, iterator __last, const __true_type &)
const_reverse_iterator rend() const
void insert(iterator __pos, size_type __n, const _Tp &__x)
const_reference front() const
const value_type * const_iterator
const_reverse_iterator rbegin() const
void _M_fill_insert_aux(iterator __pos, size_type __n, const _Tp &__x, const __true_type &)
allocator_type get_allocator() const
void _M_range_insert_realloc(iterator __pos, const_iterator __first, const_iterator __last, size_type __n)
reference at(size_type __n)
iterator _M_erase(iterator __first, iterator __last, const __false_type &)
vector< _Tp, _Alloc > _Self
ptrdiff_t difference_type
void _M_fill_assign(size_type __n, const _Tp &__val)
iterator erase(iterator __first, iterator __last)
const_reference operator[](size_type __n) const
void assign(size_type __n, const _Tp &__val)
const value_type & const_reference
void _M_range_check(size_type __n) const
const_reference at(size_type __n) const
void _M_range_insert_aux(iterator __pos, const_iterator __first, const_iterator __last, size_type __n, const __true_type &)
_STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS
pointer _M_allocate_and_copy(size_type &__n, const_pointer __first, const_pointer __last)
_STLP_PRIV _Vector_base< _Tp, _Alloc > _Base
vector(const _Tp *__first, const _Tp *__last, const allocator_type &__a=allocator_type())
void _M_insert_overflow_aux(pointer __pos, const _Tp &__x, const __true_type &, size_type __fill_len, bool __atend)
const_reference back() const
void _M_clear_after_move()