Lines Matching refs:__n
515 explicit vector(size_type __n);
517 explicit vector(size_type __n, const allocator_type& __a);
519 vector(size_type __n, const value_type& __x);
520 vector(size_type __n, const value_type& __x, const allocator_type& __a);
613 void assign(size_type __n, const_reference __u);
666 void reserve(size_type __n);
669 _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) _NOEXCEPT;
670 _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const _NOEXCEPT;
671 reference at(size_type __n);
672 const_reference at(size_type __n) const;
738 iterator insert(const_iterator __position, size_type __n, const_reference __x);
796 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
797 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
804 void __vallocate(size_type __n);
807 void __construct_at_end(size_type __n);
809 void __construct_at_end(size_type __n, const_reference __x);
816 __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n);
817 void __append(size_type __n);
818 void __append(size_type __n, const_reference __x);
884 void __annotate_increase(size_type __n) const _NOEXCEPT
887 data() + size(), data() + size() + __n);
898 explicit _ConstructTransaction(vector &__v, size_type __n)
899 : __v_(__v), __pos_(__v.__end_), __new_end_(__v.__end_ + __n) {
901 __v_.__annotate_increase(__n);
980 // Allocate space for __n objects
981 // throws length_error if __n > max_size()
984 // Precondition: __n > 0
985 // Postcondition: capacity() == __n
989 vector<_Tp, _Allocator>::__vallocate(size_type __n)
991 if (__n > max_size())
993 this->__begin_ = this->__end_ = __alloc_traits::allocate(this->__alloc(), __n);
994 this->__end_cap() = this->__begin_ + __n;
1033 // Default constructs __n objects starting at __end_
1035 // Precondition: __n > 0
1036 // Precondition: size() + __n <= capacity()
1037 // Postcondition: size() == size() + __n
1040 vector<_Tp, _Allocator>::__construct_at_end(size_type __n)
1042 _ConstructTransaction __tx(*this, __n);
1049 // Copy constructs __n objects starting at __end_ from __x
1051 // Precondition: __n > 0
1052 // Precondition: size() + __n <= capacity()
1053 // Postcondition: size() == old size() + __n
1054 // Postcondition: [i] == __x for all i in [size() - __n, __n)
1058 vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
1060 _ConstructTransaction __tx(*this, __n);
1074 …, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
1076 _ConstructTransaction __tx(*this, __n);
1080 // Default constructs __n objects starting at __end_
1082 // Postcondition: size() == size() + __n
1086 vector<_Tp, _Allocator>::__append(size_type __n)
1088 if (static_cast<size_type>(this->__end_cap() - this->__end_) >= __n)
1089 this->__construct_at_end(__n);
1093 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
1094 __v.__construct_at_end(__n);
1099 // Default constructs __n objects starting at __end_
1101 // Postcondition: size() == size() + __n
1105 vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
1107 if (static_cast<size_type>(this->__end_cap() - this->__end_) >= __n)
1108 this->__construct_at_end(__n, __x);
1112 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
1113 __v.__construct_at_end(__n, __x);
1119 vector<_Tp, _Allocator>::vector(size_type __n)
1124 if (__n > 0)
1126 __vallocate(__n);
1127 __construct_at_end(__n);
1133 vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
1139 if (__n > 0)
1141 __vallocate(__n);
1142 __construct_at_end(__n);
1148 vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
1153 if (__n > 0)
1155 __vallocate(__n);
1156 __construct_at_end(__n, __x);
1161 vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
1167 if (__n > 0)
1169 __vallocate(__n);
1170 __construct_at_end(__n, __x);
1220 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
1221 if (__n > 0)
1223 __vallocate(__n);
1224 __construct_at_end(__first, __last, __n);
1240 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
1241 if (__n > 0)
1243 __vallocate(__n);
1244 __construct_at_end(__first, __last, __n);
1255 size_type __n = __x.size();
1256 if (__n > 0)
1258 __vallocate(__n);
1259 __construct_at_end(__x.__begin_, __x.__end_, __n);
1270 size_type __n = __x.size();
1271 if (__n > 0)
1273 __vallocate(__n);
1274 __construct_at_end(__x.__begin_, __x.__end_, __n);
1468 vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
1470 if (__n <= capacity())
1473 _VSTD::fill_n(this->__begin_, _VSTD::min(__n, __s), __u);
1474 if (__n > __s)
1475 __construct_at_end(__n - __s, __u);
1477 this->__destruct_at_end(this->__begin_ + __n);
1482 __vallocate(__recommend(static_cast<size_type>(__n)));
1483 __construct_at_end(__n, __u);
1547 vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT
1549 _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
1550 return this->__begin_[__n];
1556 vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT
1558 _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
1559 return this->__begin_[__n];
1564 vector<_Tp, _Allocator>::at(size_type __n)
1566 if (__n >= size())
1568 return this->__begin_[__n];
1573 vector<_Tp, _Allocator>::at(size_type __n) const
1575 if (__n >= size())
1577 return this->__begin_[__n];
1582 vector<_Tp, _Allocator>::reserve(size_type __n)
1584 if (__n > capacity())
1587 __split_buffer<value_type, allocator_type&> __v(__n, size(), __a);
1751 difference_type __n = __old_last - __to;
1753 pointer __i = __from_s + __n;
1762 _VSTD::move_backward(__from_s, __from_s + __n, __old_last);
1872 vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
1880 if (__n > 0)
1882 if (__n <= static_cast<size_type>(this->__end_cap() - this->__end_))
1884 size_type __old_n = __n;
1886 if (__n > static_cast<size_type>(this->__end_ - __p))
1888 size_type __cx = __n - (this->__end_ - __p);
1890 __n -= __cx;
1892 if (__n > 0)
1898 _VSTD::fill_n(__p, __n, *__xr);
1904 …__split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, _…
1905 __v.__construct_at_end(__n, __x);
1984 difference_type __n = _VSTD::distance(__first, __last);
1985 if (__n > 0)
1987 if (__n <= this->__end_cap() - this->__end_)
1989 size_type __old_n = __n;
1993 if (__n > __dx)
1998 __construct_at_end(__m, __last, __n - __diff);
1999 __n = __dx;
2001 if (__n > 0)
2010 …__split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, _…
2103 vector<_Tp, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const
2105 const_pointer __p = __i->base() + __n;
2111 vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
2113 const_pointer __p = __i->base() + __n;
2211 static size_type __internal_cap_to_external(size_type __n) _NOEXCEPT
2212 {return __n * __bits_per_word;}
2214 static size_type __external_cap_to_internal(size_type __n) _NOEXCEPT
2215 {return (__n - 1) / __bits_per_word + 1;}
2228 explicit vector(size_type __n);
2230 explicit vector(size_type __n, const allocator_type& __a);
2232 vector(size_type __n, const value_type& __v);
2233 vector(size_type __n, const value_type& __v, const allocator_type& __a);
2291 void assign(size_type __n, const value_type& __x);
2312 void reserve(size_type __n);
2354 …_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __make_ref(__n);}
2355 …_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __make_ref(__n);}
2356 reference at(size_type __n);
2357 const_reference at(size_type __n) const;
2389 iterator insert(const_iterator __position, size_type __n, const value_type& __x);
2390 iterator insert(const_iterator __position, size_type __n, const_reference __x);
2435 void __vallocate(size_type __n);
2441 _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
2449 void __append(size_type __n, const_reference __x);
2521 // Allocate space for __n objects
2522 // throws length_error if __n > max_size()
2525 // Precondition: __n > 0
2526 // Postcondition: capacity() == __n
2530 vector<bool, _Allocator>::__vallocate(size_type __n)
2532 if (__n > max_size())
2534 __n = __external_cap_to_internal(__n);
2535 this->__begin_ = __storage_traits::allocate(this->__alloc(), __n);
2537 this->__cap() = __n;
2579 // Default constructs __n objects starting at __end_
2580 // Precondition: __n > 0
2581 // Precondition: size() + __n <= capacity()
2582 // Postcondition: size() == size() + __n
2586 vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x)
2589 this->__size_ += __n;
2597 _VSTD::fill_n(__make_iter(__old_size), __n, __x);
2646 vector<bool, _Allocator>::vector(size_type __n)
2651 if (__n > 0)
2653 __vallocate(__n);
2654 __construct_at_end(__n, false);
2660 vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
2665 if (__n > 0)
2667 __vallocate(__n);
2668 __construct_at_end(__n, false);
2674 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)
2679 if (__n > 0)
2681 __vallocate(__n);
2682 __construct_at_end(__n, __x);
2687 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
2692 if (__n > 0)
2694 __vallocate(__n);
2695 __construct_at_end(__n, __x);
2761 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
2762 if (__n > 0)
2764 __vallocate(__n);
2777 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
2778 if (__n > 0)
2780 __vallocate(__n);
2793 size_type __n = static_cast<size_type>(__il.size());
2794 if (__n > 0)
2796 __vallocate(__n);
2807 size_type __n = static_cast<size_type>(__il.size());
2808 if (__n > 0)
2810 __vallocate(__n);
2949 vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
2952 if (__n > 0)
2955 if (__n <= __c)
2956 __size_ = __n;
2960 __v.reserve(__recommend(__n));
2961 __v.__size_ = __n;
2964 _VSTD::fill_n(begin(), __n, __x);
2996 const size_t __n = static_cast<size_type>(__ns);
2997 if (__n)
2999 if (__n > capacity())
3002 __vallocate(__n);
3010 vector<bool, _Allocator>::reserve(size_type __n)
3012 if (__n > capacity())
3015 __v.__vallocate(__n);
3044 vector<bool, _Allocator>::at(size_type __n)
3046 if (__n >= size())
3048 return (*this)[__n];
3053 vector<bool, _Allocator>::at(size_type __n) const
3055 if (__n >= size())
3057 return (*this)[__n];
3097 vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const value_type& __x)
3101 if (__n <= __c && size() <= __c - __n)
3104 __size_ += __n;
3111 __v.reserve(__recommend(__size_ + __n));
3112 __v.__size_ = __size_ + __n;
3117 _VSTD::fill_n(__r, __n, __x);
3177 const size_type __n = static_cast<size_type>(__n_signed);
3180 if (__n <= __c && size() <= __c - __n)
3183 __size_ += __n;
3190 __v.reserve(__recommend(__size_ + __n));
3191 __v.__size_ = __size_ + __n;
3248 size_type __n = __sz - __cs;
3249 if (__n <= __c && __cs <= __c - __n)
3252 __size_ += __n;
3257 __v.reserve(__recommend(__size_ + __n));
3258 __v.__size_ = __size_ + __n;
3262 _VSTD::fill_n(__r, __n, __x);
3273 size_type __n = __size_;
3275 for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
3278 if (__n > 0)
3280 __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
3312 size_type __n = __size_;
3314 for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
3317 if (__n > 0)
3319 const __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);