_STD -> _VSTD to avoid macro clash on windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134190 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
188
include/vector
188
include/vector
@@ -405,7 +405,7 @@ private:
|
||||
void __move_assign_alloc(const __vector_base& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -417,7 +417,7 @@ private:
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
using _VSTD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -507,8 +507,8 @@ public:
|
||||
typedef __wrap_iter<pointer> iterator;
|
||||
typedef __wrap_iter<const_pointer> const_iterator;
|
||||
#endif // defined(_LIBCPP_RAW_ITERATORS)
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector()
|
||||
@@ -642,10 +642,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type* data() _NOEXCEPT
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
{return _VSTD::__to_raw_pointer(this->__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* data() const _NOEXCEPT
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
{return _VSTD::__to_raw_pointer(this->__begin_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -735,10 +735,10 @@ void
|
||||
vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v)
|
||||
{
|
||||
for (pointer __p = this->__end_; this->__begin_ < __p;)
|
||||
__v.push_front(_STD::move_if_noexcept(*--__p));
|
||||
_STD::swap(this->__begin_, __v.__begin_);
|
||||
_STD::swap(this->__end_, __v.__end_);
|
||||
_STD::swap(this->__end_cap(), __v.__end_cap());
|
||||
__v.push_front(_VSTD::move_if_noexcept(*--__p));
|
||||
_VSTD::swap(this->__begin_, __v.__begin_);
|
||||
_VSTD::swap(this->__end_, __v.__end_);
|
||||
_VSTD::swap(this->__end_cap(), __v.__end_cap());
|
||||
__v.__first_ = __v.__begin_;
|
||||
__invalidate_all_iterators();
|
||||
}
|
||||
@@ -749,12 +749,12 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
|
||||
{
|
||||
pointer __r = __v.__begin_;
|
||||
for (pointer __i = __p; this->__begin_ < __i;)
|
||||
__v.push_front(_STD::move_if_noexcept(*--__i));
|
||||
__v.push_front(_VSTD::move_if_noexcept(*--__i));
|
||||
for (pointer __i = __p; __i < this->__end_; ++__i)
|
||||
__v.push_back(_STD::move_if_noexcept(*__i));
|
||||
_STD::swap(this->__begin_, __v.__begin_);
|
||||
_STD::swap(this->__end_, __v.__end_);
|
||||
_STD::swap(this->__end_cap(), __v.__end_cap());
|
||||
__v.push_back(_VSTD::move_if_noexcept(*__i));
|
||||
_VSTD::swap(this->__begin_, __v.__begin_);
|
||||
_VSTD::swap(this->__end_, __v.__end_);
|
||||
_VSTD::swap(this->__end_cap(), __v.__end_cap());
|
||||
__v.__first_ = __v.__begin_;
|
||||
__invalidate_all_iterators();
|
||||
return __r;
|
||||
@@ -794,7 +794,7 @@ template <class _Tp, class _Allocator>
|
||||
typename vector<_Tp, _Allocator>::size_type
|
||||
vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
|
||||
{
|
||||
return _STD::min(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2); // end() >= begin(), always
|
||||
return _VSTD::min(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2); // end() >= begin(), always
|
||||
}
|
||||
|
||||
// Precondition: __new_size > capacity()
|
||||
@@ -809,7 +809,7 @@ vector<_Tp, _Allocator>::__recommend(size_type __new_size) const
|
||||
const size_type __cap = capacity();
|
||||
if (__cap >= __ms / 2)
|
||||
return __ms;
|
||||
return _STD::max(2*__cap, __new_size);
|
||||
return _VSTD::max(2*__cap, __new_size);
|
||||
}
|
||||
|
||||
// Default constructs __n objects starting at __end_
|
||||
@@ -824,7 +824,7 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n)
|
||||
allocator_type& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_));
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
@@ -844,7 +844,7 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
|
||||
allocator_type& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), __x);
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
@@ -862,7 +862,7 @@ vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIt
|
||||
allocator_type& __a = this->__alloc();
|
||||
for (; __first != __last; ++__first)
|
||||
{
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -874,8 +874,8 @@ vector<_Tp, _Allocator>::__move_construct_at_end(pointer __first, pointer __last
|
||||
allocator_type& __a = this->__alloc();
|
||||
for (; __first != __last; ++__first)
|
||||
{
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_),
|
||||
_STD::move(*__first));
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::move(*__first));
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -975,7 +975,7 @@ template <class _ForwardIterator>
|
||||
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
|
||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
|
||||
{
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
if (__n > 0)
|
||||
{
|
||||
allocate(__n);
|
||||
@@ -989,7 +989,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
|
||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
|
||||
: __base(__a)
|
||||
{
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
if (__n > 0)
|
||||
{
|
||||
allocate(__n);
|
||||
@@ -1027,7 +1027,7 @@ template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<_Tp, _Allocator>::vector(vector&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __base(_STD::move(__x.__alloc()))
|
||||
: __base(_VSTD::move(__x.__alloc()))
|
||||
{
|
||||
this->__begin_ = __x.__begin_;
|
||||
this->__end_ = __x.__end_;
|
||||
@@ -1157,7 +1157,7 @@ typename enable_if
|
||||
>::type
|
||||
vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __new_size = _STD::distance(__first, __last);
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __new_size = _VSTD::distance(__first, __last);
|
||||
if (static_cast<size_type>(__new_size) <= capacity())
|
||||
{
|
||||
_ForwardIterator __mid = __last;
|
||||
@@ -1166,9 +1166,9 @@ vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __las
|
||||
{
|
||||
__growing = true;
|
||||
__mid = __first;
|
||||
_STD::advance(__mid, size());
|
||||
_VSTD::advance(__mid, size());
|
||||
}
|
||||
pointer __m = _STD::copy(__first, __mid, this->__begin_);
|
||||
pointer __m = _VSTD::copy(__first, __mid, this->__begin_);
|
||||
if (__growing)
|
||||
__construct_at_end(__mid, __last);
|
||||
else
|
||||
@@ -1189,7 +1189,7 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
|
||||
if (__n <= capacity())
|
||||
{
|
||||
size_type __s = size();
|
||||
_STD::fill_n(this->__begin_, _STD::min(__n, __s), __u);
|
||||
_VSTD::fill_n(this->__begin_, _VSTD::min(__n, __s), __u);
|
||||
if (__n > __s)
|
||||
__construct_at_end(__n - __s, __u);
|
||||
else
|
||||
@@ -1340,7 +1340,7 @@ vector<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
if (this->__end_ < this->__end_cap())
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_), __x);
|
||||
_VSTD::__to_raw_pointer(this->__end_), __x);
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
@@ -1361,15 +1361,15 @@ vector<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
if (this->__end_ < this->__end_cap())
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_),
|
||||
_STD::move(__x));
|
||||
_VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::move(__x));
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
{
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
||||
__v.push_back(_STD::move(__x));
|
||||
__v.push_back(_VSTD::move(__x));
|
||||
__swap_out_circular_buffer(__v);
|
||||
}
|
||||
}
|
||||
@@ -1384,15 +1384,15 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
if (this->__end_ < this->__end_cap())
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
_VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
{
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
||||
__v.emplace_back(_STD::forward<_Args>(__args)...);
|
||||
__v.emplace_back(_VSTD::forward<_Args>(__args)...);
|
||||
__swap_out_circular_buffer(__v);
|
||||
}
|
||||
}
|
||||
@@ -1415,7 +1415,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
|
||||
{
|
||||
pointer __p = const_cast<pointer>(&*__position);
|
||||
iterator __r = __make_iter(__p);
|
||||
this->__destruct_at_end(_STD::move(__p + 1, this->__end_, __p));
|
||||
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
|
||||
return __r;
|
||||
}
|
||||
|
||||
@@ -1425,7 +1425,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
|
||||
{
|
||||
pointer __p = this->__begin_ + (__first - begin());
|
||||
iterator __r = __make_iter(__p);
|
||||
this->__destruct_at_end(_STD::move(__p + (__last - __first), this->__end_, __p));
|
||||
this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
|
||||
return __r;
|
||||
}
|
||||
|
||||
@@ -1437,9 +1437,9 @@ vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointe
|
||||
difference_type __n = __old_last - __to;
|
||||
for (pointer __i = __from_s + __n; __i < __from_e; ++__i, ++this->__end_)
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_),
|
||||
_STD::move(*__i));
|
||||
_STD::move_backward(__from_s, __from_s + __n, __old_last);
|
||||
_VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::move(*__i));
|
||||
_VSTD::move_backward(__from_s, __from_s + __n, __old_last);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -1452,7 +1452,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
|
||||
if (__p == this->__end_)
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_), __x);
|
||||
_VSTD::__to_raw_pointer(this->__end_), __x);
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
@@ -1486,21 +1486,21 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
|
||||
if (__p == this->__end_)
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_),
|
||||
_STD::move(__x));
|
||||
_VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::move(__x));
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
{
|
||||
__move_range(__p, this->__end_, __p + 1);
|
||||
*__p = _STD::move(__x);
|
||||
*__p = _VSTD::move(__x);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
|
||||
__v.push_back(_STD::move(__x));
|
||||
__v.push_back(_VSTD::move(__x));
|
||||
__p = __swap_out_circular_buffer(__v, __p);
|
||||
}
|
||||
return __make_iter(__p);
|
||||
@@ -1519,21 +1519,21 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
|
||||
if (__p == this->__end_)
|
||||
{
|
||||
__alloc_traits::construct(this->__alloc(),
|
||||
_STD::__to_raw_pointer(this->__end_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
_VSTD::__to_raw_pointer(this->__end_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
++this->__end_;
|
||||
}
|
||||
else
|
||||
{
|
||||
__move_range(__p, this->__end_, __p + 1);
|
||||
*__p = value_type(_STD::forward<_Args>(__args)...);
|
||||
*__p = value_type(_VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
|
||||
__v.emplace_back(_STD::forward<_Args>(__args)...);
|
||||
__v.emplace_back(_VSTD::forward<_Args>(__args)...);
|
||||
__p = __swap_out_circular_buffer(__v, __p);
|
||||
}
|
||||
return __make_iter(__p);
|
||||
@@ -1565,7 +1565,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_
|
||||
const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
|
||||
if (__p <= __xr && __xr < this->__end_)
|
||||
__xr += __old_n;
|
||||
_STD::fill_n(__p, __n, *__xr);
|
||||
_VSTD::fill_n(__p, __n, *__xr);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1595,7 +1595,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
|
||||
pointer __old_last = this->__end_;
|
||||
for (; this->__end_ != this->__end_cap() && __first != __last; ++__first)
|
||||
{
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_),
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
|
||||
*__first);
|
||||
++this->__end_;
|
||||
}
|
||||
@@ -1621,7 +1621,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__p = _STD::rotate(__p, __old_last, this->__end_);
|
||||
__p = _VSTD::rotate(__p, __old_last, this->__end_);
|
||||
insert(__make_iter(__p), move_iterator<iterator>(__v.begin()),
|
||||
move_iterator<iterator>(__v.end()));
|
||||
return begin() + __off;
|
||||
@@ -1637,7 +1637,7 @@ typename enable_if
|
||||
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
pointer __p = this->__begin_ + (__position - begin());
|
||||
difference_type __n = _STD::distance(__first, __last);
|
||||
difference_type __n = _VSTD::distance(__first, __last);
|
||||
if (__n > 0)
|
||||
{
|
||||
if (__n <= this->__end_cap() - this->__end_)
|
||||
@@ -1649,14 +1649,14 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __fi
|
||||
if (__n > __dx)
|
||||
{
|
||||
__m = __first;
|
||||
_STD::advance(__m, this->__end_ - __p);
|
||||
_VSTD::advance(__m, this->__end_ - __p);
|
||||
__construct_at_end(__m, __last);
|
||||
__n = __dx;
|
||||
}
|
||||
if (__n > 0)
|
||||
{
|
||||
__move_range(__p, __old_last, __p + __old_n);
|
||||
_STD::copy(__first, __m, __p);
|
||||
_VSTD::copy(__first, __m, __p);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1698,9 +1698,9 @@ vector<_Tp, _Allocator>::swap(vector& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
_STD::swap(this->__begin_, __x.__begin_);
|
||||
_STD::swap(this->__end_, __x.__end_);
|
||||
_STD::swap(this->__end_cap(), __x.__end_cap());
|
||||
_VSTD::swap(this->__begin_, __x.__begin_);
|
||||
_VSTD::swap(this->__end_, __x.__end_);
|
||||
_VSTD::swap(this->__end_cap(), __x.__end_cap());
|
||||
__base::__swap_alloc(this->__alloc(), __x.__alloc());
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
iterator::swap(this, &__x);
|
||||
@@ -1778,8 +1778,8 @@ public:
|
||||
typedef pointer iterator;
|
||||
typedef const_pointer const_iterator;
|
||||
#endif // _LIBCPP_DEBUG
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
private:
|
||||
typedef size_type __storage_type;
|
||||
@@ -2063,7 +2063,7 @@ private:
|
||||
void __move_assign_alloc(const vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2083,7 +2083,7 @@ private:
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
using _VSTD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2169,7 +2169,7 @@ vector<bool, _Allocator>::__recommend(size_type __new_size) const
|
||||
const size_type __cap = capacity();
|
||||
if (__cap >= __ms / 2)
|
||||
return __ms;
|
||||
return _STD::max(2*__cap, __align(__new_size));
|
||||
return _VSTD::max(2*__cap, __align(__new_size));
|
||||
}
|
||||
|
||||
// Default constructs __n objects starting at __end_
|
||||
@@ -2183,7 +2183,7 @@ vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x)
|
||||
{
|
||||
size_type __old_size = this->__size_;
|
||||
this->__size_ += __n;
|
||||
_STD::fill_n(__make_iter(__old_size), __n, __x);
|
||||
_VSTD::fill_n(__make_iter(__old_size), __n, __x);
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
@@ -2196,8 +2196,8 @@ typename enable_if
|
||||
vector<bool, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
size_type __old_size = this->__size_;
|
||||
this->__size_ += _STD::distance(__first, __last);
|
||||
_STD::copy(__first, __last, __make_iter(__old_size));
|
||||
this->__size_ += _VSTD::distance(__first, __last);
|
||||
_VSTD::copy(__first, __last, __make_iter(__old_size));
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
@@ -2320,7 +2320,7 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la
|
||||
__size_(0),
|
||||
__cap_alloc_(0)
|
||||
{
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
if (__n > 0)
|
||||
{
|
||||
allocate(__n);
|
||||
@@ -2336,7 +2336,7 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la
|
||||
__size_(0),
|
||||
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
|
||||
{
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
if (__n > 0)
|
||||
{
|
||||
allocate(__n);
|
||||
@@ -2422,7 +2422,7 @@ vector<bool, _Allocator>::operator=(const vector& __v)
|
||||
deallocate();
|
||||
allocate(__v.__size_);
|
||||
}
|
||||
_STD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
|
||||
_VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
|
||||
}
|
||||
__size_ = __v.__size_;
|
||||
}
|
||||
@@ -2520,7 +2520,7 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
|
||||
__v.__size_ = __n;
|
||||
swap(__v);
|
||||
}
|
||||
_STD::fill_n(begin(), __n, __x);
|
||||
_VSTD::fill_n(begin(), __n, __x);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2549,7 +2549,7 @@ typename enable_if
|
||||
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
clear();
|
||||
difference_type __n = _STD::distance(__first, __last);
|
||||
difference_type __n = _VSTD::distance(__first, __last);
|
||||
if (__n)
|
||||
{
|
||||
if (__n > capacity())
|
||||
@@ -2632,7 +2632,7 @@ vector<bool, _Allocator>::insert(const_iterator __position, const value_type& __
|
||||
{
|
||||
const_iterator __old_end = end();
|
||||
++__size_;
|
||||
_STD::copy_backward(__position, __old_end, end());
|
||||
_VSTD::copy_backward(__position, __old_end, end());
|
||||
__r = __const_iterator_cast(__position);
|
||||
}
|
||||
else
|
||||
@@ -2640,8 +2640,8 @@ vector<bool, _Allocator>::insert(const_iterator __position, const value_type& __
|
||||
vector __v(__alloc());
|
||||
__v.reserve(__recommend(__size_ + 1));
|
||||
__v.__size_ = __size_ + 1;
|
||||
__r = _STD::copy(cbegin(), __position, __v.begin());
|
||||
_STD::copy_backward(__position, cend(), __v.end());
|
||||
__r = _VSTD::copy(cbegin(), __position, __v.begin());
|
||||
_VSTD::copy_backward(__position, cend(), __v.end());
|
||||
swap(__v);
|
||||
}
|
||||
*__r = __x;
|
||||
@@ -2658,7 +2658,7 @@ vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const
|
||||
{
|
||||
const_iterator __old_end = end();
|
||||
__size_ += __n;
|
||||
_STD::copy_backward(__position, __old_end, end());
|
||||
_VSTD::copy_backward(__position, __old_end, end());
|
||||
__r = __const_iterator_cast(__position);
|
||||
}
|
||||
else
|
||||
@@ -2666,11 +2666,11 @@ vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const
|
||||
vector __v(__alloc());
|
||||
__v.reserve(__recommend(__size_ + __n));
|
||||
__v.__size_ = __size_ + __n;
|
||||
__r = _STD::copy(cbegin(), __position, __v.begin());
|
||||
_STD::copy_backward(__position, cend(), __v.end());
|
||||
__r = _VSTD::copy(cbegin(), __position, __v.begin());
|
||||
_VSTD::copy_backward(__position, cend(), __v.end());
|
||||
swap(__v);
|
||||
}
|
||||
_STD::fill_n(__r, __n, __x);
|
||||
_VSTD::fill_n(__r, __n, __x);
|
||||
return __r;
|
||||
}
|
||||
|
||||
@@ -2714,7 +2714,7 @@ vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __fir
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__p = _STD::rotate(__p, __old_end, end());
|
||||
__p = _VSTD::rotate(__p, __old_end, end());
|
||||
insert(__p, __v.begin(), __v.end());
|
||||
return begin() + __off;
|
||||
}
|
||||
@@ -2728,14 +2728,14 @@ typename enable_if
|
||||
>::type
|
||||
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
difference_type __n = _STD::distance(__first, __last);
|
||||
difference_type __n = _VSTD::distance(__first, __last);
|
||||
iterator __r;
|
||||
size_type __c = capacity();
|
||||
if (__n <= __c && size() <= __c - __n)
|
||||
{
|
||||
const_iterator __old_end = end();
|
||||
__size_ += __n;
|
||||
_STD::copy_backward(__position, __old_end, end());
|
||||
_VSTD::copy_backward(__position, __old_end, end());
|
||||
__r = __const_iterator_cast(__position);
|
||||
}
|
||||
else
|
||||
@@ -2743,11 +2743,11 @@ vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __f
|
||||
vector __v(__alloc());
|
||||
__v.reserve(__recommend(__size_ + __n));
|
||||
__v.__size_ = __size_ + __n;
|
||||
__r = _STD::copy(cbegin(), __position, __v.begin());
|
||||
_STD::copy_backward(__position, cend(), __v.end());
|
||||
__r = _VSTD::copy(cbegin(), __position, __v.begin());
|
||||
_VSTD::copy_backward(__position, cend(), __v.end());
|
||||
swap(__v);
|
||||
}
|
||||
_STD::copy(__first, __last, __r);
|
||||
_VSTD::copy(__first, __last, __r);
|
||||
return __r;
|
||||
}
|
||||
|
||||
@@ -2757,7 +2757,7 @@ typename vector<bool, _Allocator>::iterator
|
||||
vector<bool, _Allocator>::erase(const_iterator __position)
|
||||
{
|
||||
iterator __r = __const_iterator_cast(__position);
|
||||
_STD::copy(__position + 1, this->cend(), __r);
|
||||
_VSTD::copy(__position + 1, this->cend(), __r);
|
||||
--__size_;
|
||||
return __r;
|
||||
}
|
||||
@@ -2768,7 +2768,7 @@ vector<bool, _Allocator>::erase(const_iterator __first, const_iterator __last)
|
||||
{
|
||||
iterator __r = __const_iterator_cast(__first);
|
||||
difference_type __d = __last - __first;
|
||||
_STD::copy(__last, this->cend(), __r);
|
||||
_VSTD::copy(__last, this->cend(), __r);
|
||||
__size_ -= __d;
|
||||
return __r;
|
||||
}
|
||||
@@ -2779,9 +2779,9 @@ vector<bool, _Allocator>::swap(vector& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
_STD::swap(this->__begin_, __x.__begin_);
|
||||
_STD::swap(this->__size_, __x.__size_);
|
||||
_STD::swap(this->__cap(), __x.__cap());
|
||||
_VSTD::swap(this->__begin_, __x.__begin_);
|
||||
_VSTD::swap(this->__size_, __x.__size_);
|
||||
_VSTD::swap(this->__cap(), __x.__cap());
|
||||
__swap_alloc(this->__alloc(), __x.__alloc());
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
iterator::swap(this, &__x);
|
||||
@@ -2809,10 +2809,10 @@ vector<bool, _Allocator>::resize(size_type __sz, value_type __x)
|
||||
vector __v(__alloc());
|
||||
__v.reserve(__recommend(__size_ + __n));
|
||||
__v.__size_ = __size_ + __n;
|
||||
__r = _STD::copy(cbegin(), cend(), __v.begin());
|
||||
__r = _VSTD::copy(cbegin(), cend(), __v.begin());
|
||||
swap(__v);
|
||||
}
|
||||
_STD::fill_n(__r, __n, __x);
|
||||
_VSTD::fill_n(__r, __n, __x);
|
||||
}
|
||||
else
|
||||
__size_ = __sz;
|
||||
@@ -2890,7 +2890,7 @@ bool
|
||||
operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
|
||||
{
|
||||
const typename vector<_Tp, _Allocator>::size_type __sz = __x.size();
|
||||
return __sz == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -2906,7 +2906,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
|
||||
{
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
|
Reference in New Issue
Block a user