Implement prevector::fill once

Now that the implementation is identical, we can use a default value to
distinguish them.
pull/643/head
Ben Woosley 6 years ago
parent 7bad78c2c8
commit 69ca48717c
No known key found for this signature in database
GPG Key ID: 6EE5F3785F78B345

@ -196,11 +196,7 @@ private:
T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
void fill(T* dst, ptrdiff_t count) { void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
std::fill_n(dst, count, T{});
}
void fill(T* dst, ptrdiff_t count, const T& value) {
std::fill_n(dst, count, value); std::fill_n(dst, count, value);
} }

Loading…
Cancel
Save