| 1078 | |
| 1079 | template <class _Tp, class _Allocator> |
| 1080 | _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) { |
| 1081 | if (__n <= capacity()) { |
| 1082 | size_type __s = size(); |
| 1083 | std::fill_n(this->__begin_, std::min(__n, __s), __u); |
| 1084 | if (__n > __s) |
| 1085 | __construct_at_end(__n - __s, __u); |
| 1086 | else |
| 1087 | this->__destruct_at_end(this->__begin_ + __n); |
| 1088 | } else { |
| 1089 | __vdeallocate(); |
| 1090 | __vallocate(__recommend(static_cast<size_type>(__n))); |
| 1091 | __construct_at_end(__n, __u); |
| 1092 | } |
| 1093 | } |
| 1094 | |
| 1095 | template <class _Tp, class _Allocator> |
| 1096 | _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __n) { |
no test coverage detected