summaryrefslogtreecommitdiff
path: root/include/llvm/ADT
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r--include/llvm/ADT/SmallVector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index bd24eab93b50..35c255002001 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -415,6 +415,9 @@ public:
append(IL.begin(), IL.end());
}
+ // FIXME: Consider assigning over existing elements, rather than clearing &
+ // re-initializing them - for all assign(...) variants.
+
void assign(size_type NumElts, const T &Elt) {
clear();
if (this->capacity() < NumElts)
@@ -423,6 +426,11 @@ public:
std::uninitialized_fill(this->begin(), this->end(), Elt);
}
+ template <typename in_iter> void assign(in_iter in_start, in_iter in_end) {
+ clear();
+ append(in_start, in_end);
+ }
+
void assign(std::initializer_list<T> IL) {
clear();
append(IL);