diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 15:20:36 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 15:20:36 +0000 |
commit | d288ef4c1788d3a951a7558c68312c2d320612b1 (patch) | |
tree | ece909a5200f95f85f0813599a9500620f4d9217 /include/llvm/ADT | |
parent | f382538d471e38a9b98f016c4caebd24c8d60b62 (diff) |
Notes
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index bd24eab93b503..35c2550020019 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); |