• Home
  • Raw
  • Download

Lines Matching refs:__n

494     explicit vector(size_type __n);
496 explicit vector(size_type __n, const allocator_type& __a);
498 vector(size_type __n, const_reference __x);
499 vector(size_type __n, const_reference __x, const allocator_type& __a);
588 void assign(size_type __n, const_reference __u);
640 void reserve(size_type __n);
643 _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n);
644 _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const;
645 reference at(size_type __n);
646 const_reference at(size_type __n) const;
700 iterator insert(const_iterator __position, size_type __n, const_reference __x);
757 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
758 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
765 void allocate(size_type __n);
768 void __construct_at_end(size_type __n);
770 void __construct_at_end(size_type __n, const_reference __x);
777 __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n);
778 void __append(size_type __n);
779 void __append(size_type __n, const_reference __x);
842 void __annotate_increase(size_type __n) const
845 data() + size(), data() + size() + __n);
858 __RAII_IncreaseAnnotator(const vector &__v, size_type __n = 1)
859 : __commit(false), __v(__v), __old_size(__v.size() + __n) {
860 __v.__annotate_increase(__n);
912 // Allocate space for __n objects
913 // throws length_error if __n > max_size()
916 // Precondition: __n > 0
917 // Postcondition: capacity() == __n
921 vector<_Tp, _Allocator>::allocate(size_type __n)
923 if (__n > max_size())
925 this->__begin_ = this->__end_ = __alloc_traits::allocate(this->__alloc(), __n);
926 this->__end_cap() = this->__begin_ + __n;
965 // Default constructs __n objects starting at __end_
967 // Precondition: __n > 0
968 // Precondition: size() + __n <= capacity()
969 // Postcondition: size() == size() + __n
972 vector<_Tp, _Allocator>::__construct_at_end(size_type __n)
980 --__n;
982 } while (__n > 0);
985 // Copy constructs __n objects starting at __end_ from __x
987 // Precondition: __n > 0
988 // Precondition: size() + __n <= capacity()
989 // Postcondition: size() == old size() + __n
990 // Postcondition: [i] == __x for all i in [size() - __n, __n)
994 vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
1002 --__n;
1004 } while (__n > 0);
1014 …, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
1017 __RAII_IncreaseAnnotator __annotator(*this, __n);
1022 // Default constructs __n objects starting at __end_
1024 // Postcondition: size() == size() + __n
1028 vector<_Tp, _Allocator>::__append(size_type __n)
1030 if (static_cast<size_type>(this->__end_cap() - this->__end_) >= __n)
1031 this->__construct_at_end(__n);
1035 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
1036 __v.__construct_at_end(__n);
1041 // Default constructs __n objects starting at __end_
1043 // Postcondition: size() == size() + __n
1047 vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
1049 if (static_cast<size_type>(this->__end_cap() - this->__end_) >= __n)
1050 this->__construct_at_end(__n, __x);
1054 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
1055 __v.__construct_at_end(__n, __x);
1061 vector<_Tp, _Allocator>::vector(size_type __n)
1066 if (__n > 0)
1068 allocate(__n);
1069 __construct_at_end(__n);
1075 vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
1081 if (__n > 0)
1083 allocate(__n);
1084 __construct_at_end(__n);
1090 vector<_Tp, _Allocator>::vector(size_type __n, const_reference __x)
1095 if (__n > 0)
1097 allocate(__n);
1098 __construct_at_end(__n, __x);
1103 vector<_Tp, _Allocator>::vector(size_type __n, const_reference __x, const allocator_type& __a)
1109 if (__n > 0)
1111 allocate(__n);
1112 __construct_at_end(__n, __x);
1162 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
1163 if (__n > 0)
1165 allocate(__n);
1166 __construct_at_end(__first, __last, __n);
1182 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
1183 if (__n > 0)
1185 allocate(__n);
1186 __construct_at_end(__first, __last, __n);
1197 size_type __n = __x.size();
1198 if (__n > 0)
1200 allocate(__n);
1201 __construct_at_end(__x.__begin_, __x.__end_, __n);
1212 size_type __n = __x.size();
1213 if (__n > 0)
1215 allocate(__n);
1216 __construct_at_end(__x.__begin_, __x.__end_, __n);
1414 vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
1416 if (__n <= capacity())
1419 _VSTD::fill_n(this->__begin_, _VSTD::min(__n, __s), __u);
1420 if (__n > __s)
1421 __construct_at_end(__n - __s, __u);
1423 this->__destruct_at_end(this->__begin_ + __n);
1428 allocate(__recommend(static_cast<size_type>(__n)));
1429 __construct_at_end(__n, __u);
1493 vector<_Tp, _Allocator>::operator[](size_type __n)
1495 _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
1496 return this->__begin_[__n];
1502 vector<_Tp, _Allocator>::operator[](size_type __n) const
1504 _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
1505 return this->__begin_[__n];
1510 vector<_Tp, _Allocator>::at(size_type __n)
1512 if (__n >= size())
1514 return this->__begin_[__n];
1519 vector<_Tp, _Allocator>::at(size_type __n) const
1521 if (__n >= size())
1523 return this->__begin_[__n];
1528 vector<_Tp, _Allocator>::reserve(size_type __n)
1530 if (__n > capacity())
1533 __split_buffer<value_type, allocator_type&> __v(__n, size(), __a);
1714 difference_type __n = __old_last - __to;
1715 for (pointer __i = __from_s + __n; __i < __from_e; ++__i, ++this->__end_)
1719 _VSTD::move_backward(__from_s, __from_s + __n, __old_last);
1846 vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
1854 if (__n > 0)
1856 if (__n <= static_cast<size_type>(this->__end_cap() - this->__end_))
1858 size_type __old_n = __n;
1860 if (__n > static_cast<size_type>(this->__end_ - __p))
1862 size_type __cx = __n - (this->__end_ - __p);
1864 __n -= __cx;
1866 if (__n > 0)
1868 __RAII_IncreaseAnnotator __annotator(*this, __n);
1874 _VSTD::fill_n(__p, __n, *__xr);
1880 …__split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, _…
1881 __v.__construct_at_end(__n, __x);
1964 difference_type __n = _VSTD::distance(__first, __last);
1965 if (__n > 0)
1967 if (__n <= this->__end_cap() - this->__end_)
1969 size_type __old_n = __n;
1973 if (__n > __dx)
1978 __construct_at_end(__m, __last, __n - __diff);
1979 __n = __dx;
1981 if (__n > 0)
1983 __RAII_IncreaseAnnotator __annotator(*this, __n);
1992 …__split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, _…
2085 vector<_Tp, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const
2087 const_pointer __p = __i->base() + __n;
2093 vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
2095 const_pointer __p = __i->base() + __n;
2193 static size_type __internal_cap_to_external(size_type __n) _NOEXCEPT
2194 {return __n * __bits_per_word;}
2196 static size_type __external_cap_to_internal(size_type __n) _NOEXCEPT
2197 {return (__n - 1) / __bits_per_word + 1;}
2210 explicit vector(size_type __n);
2212 explicit vector(size_type __n, const allocator_type& __a);
2214 vector(size_type __n, const value_type& __v);
2215 vector(size_type __n, const value_type& __v, const allocator_type& __a);
2274 void assign(size_type __n, const value_type& __x);
2294 void reserve(size_type __n);
2336 …_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __make_ref(__n);}
2337 …_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __make_ref(__n);}
2338 reference at(size_type __n);
2339 const_reference at(size_type __n) const;
2371 iterator insert(const_iterator __position, size_type __n, const value_type& __x);
2372 iterator insert(const_iterator __position, size_type __n, const_reference __x);
2416 void allocate(size_type __n);
2422 _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
2430 void __append(size_type __n, const_reference __x);
2502 // Allocate space for __n objects
2503 // throws length_error if __n > max_size()
2506 // Precondition: __n > 0
2507 // Postcondition: capacity() == __n
2511 vector<bool, _Allocator>::allocate(size_type __n)
2513 if (__n > max_size())
2515 __n = __external_cap_to_internal(__n);
2516 this->__begin_ = __storage_traits::allocate(this->__alloc(), __n);
2518 this->__cap() = __n;
2560 // Default constructs __n objects starting at __end_
2561 // Precondition: __n > 0
2562 // Precondition: size() + __n <= capacity()
2563 // Postcondition: size() == size() + __n
2567 vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x)
2570 this->__size_ += __n;
2571 _VSTD::fill_n(__make_iter(__old_size), __n, __x);
2613 vector<bool, _Allocator>::vector(size_type __n)
2618 if (__n > 0)
2620 allocate(__n);
2621 __construct_at_end(__n, false);
2627 vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
2632 if (__n > 0)
2634 allocate(__n);
2635 __construct_at_end(__n, false);
2641 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)
2646 if (__n > 0)
2648 allocate(__n);
2649 __construct_at_end(__n, __x);
2654 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
2659 if (__n > 0)
2661 allocate(__n);
2662 __construct_at_end(__n, __x);
2728 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
2729 if (__n > 0)
2731 allocate(__n);
2744 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
2745 if (__n > 0)
2747 allocate(__n);
2760 size_type __n = static_cast<size_type>(__il.size());
2761 if (__n > 0)
2763 allocate(__n);
2774 size_type __n = static_cast<size_type>(__il.size());
2775 if (__n > 0)
2777 allocate(__n);
2918 vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
2921 if (__n > 0)
2924 if (__n <= __c)
2925 __size_ = __n;
2929 __v.reserve(__recommend(__n));
2930 __v.__size_ = __n;
2933 _VSTD::fill_n(begin(), __n, __x);
2965 const size_t __n = static_cast<size_type>(__ns);
2966 if (__n)
2968 if (__n > capacity())
2971 allocate(__n);
2979 vector<bool, _Allocator>::reserve(size_type __n)
2981 if (__n > capacity())
2984 __v.allocate(__n);
3013 vector<bool, _Allocator>::at(size_type __n)
3015 if (__n >= size())
3017 return (*this)[__n];
3022 vector<bool, _Allocator>::at(size_type __n) const
3024 if (__n >= size())
3026 return (*this)[__n];
3066 vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const value_type& __x)
3070 if (__n <= __c && size() <= __c - __n)
3073 __size_ += __n;
3080 __v.reserve(__recommend(__size_ + __n));
3081 __v.__size_ = __size_ + __n;
3086 _VSTD::fill_n(__r, __n, __x);
3146 const size_type __n = static_cast<size_type>(__n_signed);
3149 if (__n <= __c && size() <= __c - __n)
3152 __size_ += __n;
3159 __v.reserve(__recommend(__size_ + __n));
3160 __v.__size_ = __size_ + __n;
3217 size_type __n = __sz - __cs;
3218 if (__n <= __c && __cs <= __c - __n)
3221 __size_ += __n;
3226 __v.reserve(__recommend(__size_ + __n));
3227 __v.__size_ = __size_ + __n;
3231 _VSTD::fill_n(__r, __n, __x);
3242 size_type __n = __size_;
3244 for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
3247 if (__n > 0)
3249 __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
3281 size_type __n = __size_;
3283 for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
3286 if (__n > 0)
3288 const __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);