| 721 | void append(const small_vector_impl &RHS) { append(RHS.begin(), RHS.end()); } |
| 722 | |
| 723 | void assign(size_type NumElts, ValueParamT Elt) { |
| 724 | // Note that Elt could be an internal reference. |
| 725 | if (NumElts > this->capacity()) { |
| 726 | this->growAndAssign(NumElts, Elt); |
| 727 | return; |
| 728 | } |
| 729 | |
| 730 | // Assign over existing elements. |
| 731 | std::fill_n(this->begin(), (std::min)(NumElts, this->size()), Elt); |
| 732 | if (NumElts > this->size()) |
| 733 | std::uninitialized_fill_n(this->end(), NumElts - this->size(), Elt); |
| 734 | else if (NumElts < this->size()) |
| 735 | this->destroy_range(this->begin() + NumElts, this->end()); |
| 736 | this->set_size(NumElts); |
| 737 | } |
| 738 | |
| 739 | // FIXME: Consider assigning over existing elements, rather than clearing & |
| 740 | // re-initializing them - for all assign(...) variants. |
no test coverage detected