Implement prevector::fill once
Now that the implementation is identical, we can use a default value to distinguish them.
This commit is contained in:
parent
7bad78c2c8
commit
69ca48717c
1 changed files with 1 additions and 5 deletions
|
@ -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…
Reference in a new issue