Skip to content

Commit 69ca487

Browse files
committed
Implement prevector::fill once
Now that the implementation is identical, we can use a default value to distinguish them.
1 parent 7bad78c commit 69ca487

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/prevector.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ class prevector {
196196
T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
197197
const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
198198

199-
void fill(T* dst, ptrdiff_t count) {
200-
std::fill_n(dst, count, T{});
201-
}
202-
203-
void fill(T* dst, ptrdiff_t count, const T& value) {
199+
void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
204200
std::fill_n(dst, count, value);
205201
}
206202

0 commit comments

Comments
 (0)