Lines Matching refs:__n
357 _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator+=(difference_type __n)
359 if (__n != 0)
361 __n += __ptr_ - *__m_iter_;
362 if (__n > 0)
364 __m_iter_ += __n / __block_size;
365 __ptr_ = *__m_iter_ + __n % __block_size;
367 else // (__n < 0)
369 difference_type __z = __block_size - 1 - __n;
377 _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator-=(difference_type __n)
379 return *this += -__n;
382 _LIBCPP_INLINE_VISIBILITY __deque_iterator operator+(difference_type __n) const
385 __t += __n;
389 _LIBCPP_INLINE_VISIBILITY __deque_iterator operator-(difference_type __n) const
392 __t -= __n;
397 friend __deque_iterator operator+(difference_type __n, const __deque_iterator& __it)
398 {return __it + __n;}
410 _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
411 {return *(*this + __n);}
572 difference_type __n = __l - __f;
574 if (__n > __bs)
576 __n = __bs;
577 __m = __f + __n;
581 __r += __n;
596 difference_type __n = __l - __f;
597 while (__n > 0)
602 if (__bs > __n)
604 __bs = __n;
608 __n -= __bs;
624 difference_type __n = __l - __f;
625 while (__n > 0)
630 if (__bs > __n)
632 __bs = __n;
636 __n -= __bs;
660 difference_type __n = __l - __f;
662 if (__n > __bs)
664 __n = __bs;
665 __m = __l - __n;
669 __r -= __n;
683 difference_type __n = __l - __f;
684 while (__n > 0)
690 if (__bs > __n)
692 __bs = __n;
696 __n -= __bs;
711 difference_type __n = __l - __f;
712 while (__n > 0)
718 if (__bs > __n)
720 __bs = __n;
724 __n -= __bs;
748 difference_type __n = __l - __f;
750 if (__n > __bs)
752 __n = __bs;
753 __m = __f + __n;
757 __r += __n;
772 difference_type __n = __l - __f;
773 while (__n > 0)
778 if (__bs > __n)
780 __bs = __n;
784 __n -= __bs;
800 difference_type __n = __l - __f;
801 while (__n > 0)
806 if (__bs > __n)
808 __bs = __n;
812 __n -= __bs;
836 difference_type __n = __l - __f;
838 if (__n > __bs)
840 __n = __bs;
841 __m = __l - __n;
845 __r -= __n;
859 difference_type __n = __l - __f;
860 while (__n > 0)
866 if (__bs > __n)
868 __bs = __n;
872 __n -= __bs;
887 difference_type __n = __l - __f;
888 while (__n > 0)
894 if (__bs > __n)
896 __bs = __n;
900 __n -= __bs;
1232 explicit deque(size_type __n);
1234 explicit deque(size_type __n, const _Allocator& __a);
1236 deque(size_type __n, const value_type& __v);
1237 deque(size_type __n, const value_type& __v, const allocator_type& __a);
1276 void assign(size_type __n, const value_type& __v);
1326 void resize(size_type __n);
1327 void resize(size_type __n, const value_type& __v);
1372 iterator insert(const_iterator __p, size_type __n, const value_type& __v);
1407 static size_type __recommend_blocks(size_type __n)
1409 return __n / __base::__block_size + (__n % __base::__block_size != 0);
1434 void __append(size_type __n);
1435 void __append(size_type __n, const value_type& __v);
1438 void __add_front_capacity(size_type __n);
1440 void __add_back_capacity(size_type __n);
1494 deque<_Tp, _Allocator>::deque(size_type __n)
1496 if (__n > 0)
1497 __append(__n);
1502 deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
1505 if (__n > 0)
1506 __append(__n);
1511 deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
1513 if (__n > 0)
1514 __append(__n, __v);
1518 deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v, const allocator_type& __a)
1521 if (__n > 0)
1522 __append(__n, __v);
1675 deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
1677 if (__n > __base::size())
1680 __n -= __base::size();
1681 __append(__n, __v);
1684 __erase_to_end(_VSTD::fill_n(__base::begin(), __n, __v));
1697 deque<_Tp, _Allocator>::resize(size_type __n)
1699 if (__n > __base::size())
1700 __append(__n - __base::size());
1701 else if (__n < __base::size())
1702 __erase_to_end(__base::begin() + __n);
1707 deque<_Tp, _Allocator>::resize(size_type __n, const value_type& __v)
1709 if (__n > __base::size())
1710 __append(__n - __base::size(), __v);
1711 else if (__n < __base::size())
1712 __erase_to_end(__base::begin() + __n);
2095 deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v)
2102 if (__n > __front_spare())
2103 __add_front_capacity(__n - __front_spare());
2104 // __n <= __front_spare()
2107 if (__n > __pos)
2109 for (size_type __m = __n - __pos; __m; --__m, --__base::__start_, ++__base::size())
2111 __n = __pos;
2113 if (__n > 0)
2116 iterator __obn = __old_begin + __n;
2118 if (__n < __pos)
2120 _VSTD::fill_n(__old_begin, __n, *__vt);
2126 if (__n > __back_capacity)
2127 __add_back_capacity(__n - __back_capacity);
2128 // __n <= __back_capacity
2132 if (__n > __de)
2134 for (size_type __m = __n - __de; __m; --__m, ++__i, ++__base::size())
2136 __n = __de;
2138 if (__n > 0)
2141 iterator __oen = __old_end - __n;
2143 if (__n < __de)
2145 _VSTD::fill_n(__old_end - __n, __n, *__vt);
2171 size_type __n = _VSTD::distance(__f, __l);
2172 __split_buffer<value_type, allocator_type&> __buf(__n, 0, __base::__alloc());
2184 size_type __n = _VSTD::distance(__f, __l);
2190 if (__n > __front_spare())
2191 __add_front_capacity(__n - __front_spare());
2192 // __n <= __front_spare()
2196 if (__n > __pos)
2198 __m = __pos < __n / 2 ? _VSTD::prev(__l, __pos) : _VSTD::next(__f, __n - __pos);
2201 __n = __pos;
2203 if (__n > 0)
2205 iterator __obn = __old_begin + __n;
2212 if (__n < __pos)
2220 if (__n > __back_capacity)
2221 __add_back_capacity(__n - __back_capacity);
2222 // __n <= __back_capacity
2227 if (__n > __de)
2229 __m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
2232 __n = __de;
2234 if (__n > 0)
2236 iterator __oen = __old_end - __n;
2239 if (__n < __de)
2268 size_type __n = _VSTD::distance(__f, __l);
2271 if (__n > __back_capacity)
2272 __add_back_capacity(__n - __back_capacity);
2273 // __n <= __back_capacity
2280 deque<_Tp, _Allocator>::__append(size_type __n)
2284 if (__n > __back_capacity)
2285 __add_back_capacity(__n - __back_capacity);
2286 // __n <= __back_capacity
2287 for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
2293 deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
2297 if (__n > __back_capacity)
2298 __add_back_capacity(__n - __back_capacity);
2299 // __n <= __back_capacity
2300 for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
2364 // Create front capacity for __n elements.
2368 deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
2371 size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
2504 // Create back capacity for __n elements.
2508 deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
2511 size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
2636 difference_type __n = __l - __f;
2637 while (__n > 0)
2642 if (__bs > __n)
2644 __bs = __n;
2650 __n -= __bs;
2666 difference_type __n = __l - __f;
2667 while (__n > 0)
2673 if (__bs > __n)
2675 __bs = __n;
2681 __n -= __bs;
2698 difference_type __n = __l - __f;
2699 while (__n > 0)
2704 if (__bs > __n)
2706 __bs = __n;
2713 __n -= __bs;
2733 difference_type __n = __l - __f;
2734 while (__n > 0)
2740 if (__bs > __n)
2742 __bs = __n;
2753 __n -= __bs;
2797 difference_type __n = __l - __f;
2801 if (__n > 0)
2804 if (static_cast<size_t>(__pos) <= (__base::size() - __n) / 2)
2806 iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
2809 __base::size() -= __n;
2810 __base::__start_ += __n;
2820 iterator __i = _VSTD::move(__p + __n, __base::end(), __p);
2823 __base::size() -= __n;
2839 difference_type __n = __e - __f;
2840 if (__n > 0)
2847 __base::size() -= __n;