private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
_LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last);
- void allocate(size_type __n);
- void deallocate() _NOEXCEPT;
+ void __vallocate(size_type __n);
+ void __vdeallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
void __construct_at_end(size_type __n);
_LIBCPP_INLINE_VISIBILITY
// Postcondition: size() == 0
template <class _Tp, class _Allocator>
void
-vector<_Tp, _Allocator>::allocate(size_type __n)
+vector<_Tp, _Allocator>::__vallocate(size_type __n)
{
if (__n > max_size())
this->__throw_length_error();
template <class _Tp, class _Allocator>
void
-vector<_Tp, _Allocator>::deallocate() _NOEXCEPT
+vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT
{
if (this->__begin_ != nullptr)
{
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n);
}
}
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n);
}
}
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last, __n);
}
}
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last, __n);
}
}
size_type __n = __x.size();
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__x.__begin_, __x.__end_, __n);
}
}
size_type __n = __x.size();
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__x.__begin_, __x.__end_, __n);
}
}
#endif
if (__il.size() > 0)
{
- allocate(__il.size());
+ __vallocate(__il.size());
__construct_at_end(__il.begin(), __il.end(), __il.size());
}
}
#endif
if (__il.size() > 0)
{
- allocate(__il.size());
+ __vallocate(__il.size());
__construct_at_end(__il.begin(), __il.end(), __il.size());
}
}
vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
- deallocate();
+ __vdeallocate();
__base::__move_assign_alloc(__c); // this can throw
this->__begin_ = __c.__begin_;
this->__end_ = __c.__end_;
}
else
{
- deallocate();
- allocate(__recommend(__new_size));
+ __vdeallocate();
+ __vallocate(__recommend(__new_size));
__construct_at_end(__first, __last, __new_size);
}
__invalidate_all_iterators();
}
else
{
- deallocate();
- allocate(__recommend(static_cast<size_type>(__n)));
+ __vdeallocate();
+ __vallocate(__recommend(static_cast<size_type>(__n)));
__construct_at_end(__n, __u);
}
__invalidate_all_iterators();
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
- void allocate(size_type __n);
- void deallocate() _NOEXCEPT;
+ void __vallocate(size_type __n);
+ void __vdeallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
static size_type __align_it(size_type __new_size) _NOEXCEPT
{return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);};
void __copy_assign_alloc(const vector& __c, true_type)
{
if (__alloc() != __c.__alloc())
- deallocate();
+ __vdeallocate();
__alloc() = __c.__alloc();
}
// Postcondition: size() == 0
template <class _Allocator>
void
-vector<bool, _Allocator>::allocate(size_type __n)
+vector<bool, _Allocator>::__vallocate(size_type __n)
{
if (__n > max_size())
this->__throw_length_error();
template <class _Allocator>
void
-vector<bool, _Allocator>::deallocate() _NOEXCEPT
+vector<bool, _Allocator>::__vdeallocate() _NOEXCEPT
{
if (this->__begin_ != nullptr)
{
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, false);
}
}
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, false);
}
}
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last);
}
}
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last);
}
}
size_type __n = static_cast<size_type>(__il.size());
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__il.begin(), __il.end());
}
}
size_type __n = static_cast<size_type>(__il.size());
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__il.begin(), __il.end());
}
}
{
if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
{
if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
{
if (__v.__size_ > capacity())
{
- deallocate();
- allocate(__v.__size_);
+ __vdeallocate();
+ __vallocate(__v.__size_);
}
_VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
}
}
else if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
- deallocate();
+ __vdeallocate();
__move_assign_alloc(__c);
this->__begin_ = __c.__begin_;
this->__size_ = __c.__size_;
{
if (__n > capacity())
{
- deallocate();
- allocate(__n);
+ __vdeallocate();
+ __vallocate(__n);
}
__construct_at_end(__first, __last);
}
if (__n > capacity())
{
vector __v(this->__alloc());
- __v.allocate(__n);
+ __v.__vallocate(__n);
__v.__construct_at_end(this->begin(), this->end());
swap(__v);
__invalidate_all_iterators();