Skip to content

Commit

Permalink
Implement prevector::fill once
Browse files Browse the repository at this point in the history
Now that the implementation is identical, we can use a default value to
distinguish them.
  • Loading branch information
Empact committed Nov 14, 2018
1 parent 7bad78c commit 69ca487
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/prevector.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ class prevector {
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); }

void fill(T* dst, ptrdiff_t count) {
std::fill_n(dst, count, T{});
}

void fill(T* dst, ptrdiff_t count, const T& value) {
void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
std::fill_n(dst, count, value);
}

Expand Down

0 comments on commit 69ca487

Please sign in to comment.