}
void _M_insert_aux(iterator __position, bool __x) {
if (this->_M_finish._M_p != this->_M_end_of_storage) {
- copy_backward(__position, this->_M_finish, this->_M_finish + 1);
+ std::copy_backward(__position, this->_M_finish, this->_M_finish + 1);
*__position = __x;
++this->_M_finish;
}
size_type __len = size()
? 2 * size() : static_cast<size_type>(_S_word_bit);
_Bit_type * __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
+ iterator __i = std::copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
- this->_M_finish = copy(__position, end(), __i);
+ this->_M_finish = std::copy(__position, end(), __i);
_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
forward_iterator_tag) {
size_type __n = std::distance(__first, __last);
_M_initialize(__n);
- copy(__first, __last, this->_M_start);
+ std::copy(__first, __last, this->_M_start);
}
template <class _InputIterator>
if (__first != __last) {
size_type __n = std::distance(__first, __last);
if (capacity() - size() >= __n) {
- copy_backward(__position, end(),
- this->_M_finish + difference_type(__n));
- copy(__first, __last, __position);
+ std::copy_backward(__position, end(),
+ this->_M_finish + difference_type(__n));
+ std::copy(__first, __last, __position);
this->_M_finish += difference_type(__n);
}
else {
size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- __i = copy(__first, __last, __i);
- this->_M_finish = copy(__position, end(), __i);
+ iterator __i = std::copy(begin(), __position, iterator(__q, 0));
+ __i = std::copy(__first, __last, __i);
+ this->_M_finish = std::copy(__position, end(), __i);
_M_deallocate();
this->_M_end_of_storage
= __q + (__len + _S_word_bit - 1)/_S_word_bit;
: _Bvector_base<_Alloc>(__a)
{
_M_initialize(__n);
- fill(this->_M_start._M_p, this->_M_end_of_storage, __value ? ~0 : 0);
+ std::fill(this->_M_start._M_p, this->_M_end_of_storage, __value ? ~0 : 0);
}
explicit vector(size_type __n)
: _Bvector_base<_Alloc>(allocator_type())
{
_M_initialize(__n);
- fill(this->_M_start._M_p, this->_M_end_of_storage, 0);
+ std::fill(this->_M_start._M_p, this->_M_end_of_storage, 0);
}
vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) {
_M_initialize(__x.size());
- copy(__x.begin(), __x.end(), this->_M_start);
+ std::copy(__x.begin(), __x.end(), this->_M_start);
}
// Check whether it's an integral type. If so, it's not an iterator.
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize(__n);
- fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
+ std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
template <class _InputIterator>
_M_deallocate();
_M_initialize(__x.size());
}
- copy(__x.begin(), __x.end(), begin());
+ std::copy(__x.begin(), __x.end(), begin());
this->_M_finish = begin() + difference_type(__x.size());
return *this;
}
void _M_fill_assign(size_t __n, bool __x) {
if (__n > size()) {
- fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
+ std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else {
erase(begin() + __n, end());
- fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
+ std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
}
forward_iterator_tag) {
size_type __len = std::distance(__first, __last);
if (__len < size())
- erase(copy(__first, __last, begin()), end());
+ erase(std::copy(__first, __last, begin()), end());
else {
_ForwardIterator __mid = __first;
- advance(__mid, size());
- copy(__first, __mid, begin());
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
__throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n) {
_Bit_type * __q = _M_bit_alloc(__n);
- this->_M_finish = copy(begin(), end(), iterator(__q, 0));
+ this->_M_finish = std::copy(begin(), end(), iterator(__q, 0));
_M_deallocate();
this->_M_start = iterator(__q, 0);
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
void _M_fill_insert(iterator __position, size_type __n, bool __x) {
if (__n == 0) return;
if (capacity() - size() >= __n) {
- copy_backward(__position, end(),
- this->_M_finish + difference_type(__n));
- fill(__position, __position + difference_type(__n), __x);
+ std::copy_backward(__position, end(),
+ this->_M_finish + difference_type(__n));
+ std::fill(__position, __position + difference_type(__n), __x);
this->_M_finish += difference_type(__n);
}
else {
size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- fill_n(__i, __n, __x);
- this->_M_finish = copy(__position, end(), __i + difference_type(__n));
+ iterator __i = std::copy(begin(), __position, iterator(__q, 0));
+ std::fill_n(__i, __n, __x);
+ this->_M_finish = std::copy(__position, end(), __i + difference_type(__n));
_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
void pop_back() { --this->_M_finish; }
iterator erase(iterator __position) {
if (__position + 1 != end())
- copy(__position + 1, end(), __position);
+ std::copy(__position + 1, end(), __position);
--this->_M_finish;
return __position;
}
iterator erase(iterator __first, iterator __last) {
- this->_M_finish = copy(__last, end(), __first);
+ this->_M_finish = std::copy(__last, end(), __first);
return __first;
}
void resize(size_type __new_size, bool __x = bool()) {
*/
deque(const deque& __x)
: _Base(__x.get_allocator(), __x.size())
- { uninitialized_copy(__x.begin(), __x.end(), this->_M_start); }
+ { std::uninitialized_copy(__x.begin(), __x.end(), this->_M_start); }
/**
* @brief Builds a %deque from a range.
* themselves are pointers, the pointed-to memory is not touched in any
* way. Managing the pointer is the user's responsibilty.
*/
- ~deque() { _Destroy(this->_M_start, this->_M_finish); }
+ ~deque() { std::_Destroy(this->_M_start, this->_M_finish); }
/**
* @brief %Deque assignment operator.
push_front(const value_type& __x)
{
if (this->_M_start._M_cur != this->_M_start._M_first) {
- _Construct(this->_M_start._M_cur - 1, __x);
+ std::_Construct(this->_M_start._M_cur - 1, __x);
--this->_M_start._M_cur;
}
else
push_back(const value_type& __x)
{
if (this->_M_finish._M_cur != this->_M_finish._M_last - 1) {
- _Construct(this->_M_finish._M_cur, __x);
+ std::_Construct(this->_M_finish._M_cur, __x);
++this->_M_finish._M_cur;
}
else
pop_front()
{
if (this->_M_start._M_cur != this->_M_start._M_last - 1) {
- _Destroy(this->_M_start._M_cur);
+ std::_Destroy(this->_M_start._M_cur);
++this->_M_start._M_cur;
}
else
{
if (this->_M_finish._M_cur != this->_M_finish._M_first) {
--this->_M_finish._M_cur;
- _Destroy(this->_M_finish._M_cur);
+ std::_Destroy(this->_M_finish._M_cur);
}
else
_M_pop_back_aux();
size_type __len = std::distance(__first, __last);
if (__len > size()) {
_ForwardIterator __mid = __first;
- advance(__mid, size());
- copy(__first, __mid, begin());
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
else
- erase(copy(__first, __last, begin()), end());
+ erase(std::copy(__first, __last, begin()), end());
}
// Called by assign(n,t), and the range assign when it turns out to be the
{
if (__n > size())
{
- fill(begin(), end(), __val);
+ std::fill(begin(), end(), __val);
insert(end(), __n - size(), __val);
}
else
{
erase(begin() + __n, end());
- fill(begin(), end(), __val);
+ std::fill(begin(), end(), __val);
}
}
const deque<_Tp, _Alloc>& __y)
{
return __x.size() == __y.size() &&
- equal(__x.begin(), __x.end(), __y.begin());
+ std::equal(__x.begin(), __x.end(), __y.begin());
}
/**