Merge #14028: Explicitly initialize prevector _union

1d9aa008d6e043c29c3c5b030a6d04278aea233b Explicitly initialize prevector _union (Ben Woosley)

Pull request description:

Tree-SHA512: 3037a5d63b840a4cb0c3c26593ce1b7e1a6ba273a4ee5072563b20169be9783dbdfe3a38c9651d73b2d18ed9668deaf65f994eca7f225c70f875716f05eda3a6
This commit is contained in:
Wladimir J. van der Laan 2018-08-29 15:01:29 +02:00 committed by pasta
parent b619f993e7
commit 2d91eb7b77

View File

@ -265,32 +265,32 @@ public:
prevector() : _size(0), _union{{}} {}
explicit prevector(size_type n) : _size(0) {
explicit prevector(size_type n) : prevector() {
resize(n);
}
explicit prevector(size_type n, const T& val) : _size(0) {
explicit prevector(size_type n, const T& val) : prevector() {
change_capacity(n);
_size += n;
fill(item_ptr(0), n, val);
}
template<typename InputIterator>
prevector(InputIterator first, InputIterator last) : _size(0) {
prevector(InputIterator first, InputIterator last) : prevector() {
size_type n = last - first;
change_capacity(n);
_size += n;
fill(item_ptr(0), first, last);
}
prevector(const prevector<N, T, Size, Diff>& other) : _size(0) {
prevector(const prevector<N, T, Size, Diff>& other) : prevector() {
size_type n = other.size();
change_capacity(n);
_size += n;
fill(item_ptr(0), other.begin(), other.end());
}
prevector(prevector<N, T, Size, Diff>&& other) : _size(0) {
prevector(prevector<N, T, Size, Diff>&& other) : prevector() {
swap(other);
}