aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-11-13 04:15:27 -0500
committerBen Woosley <ben.woosley@gmail.com>2018-11-14 12:19:28 -0500
commit69ca48717ceb31e37e90276278362c809cf98cc6 (patch)
treebad0f56a81b0894ece1a03c3ff8f59c13b2771b0 /src
parent7bad78c2c83d73b7e0518f3e1b835f0157b80ec6 (diff)
Implement prevector::fill once
Now that the implementation is identical, we can use a default value to distinguish them.
Diffstat (limited to 'src')
-rw-r--r--src/prevector.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/prevector.h b/src/prevector.h
index 7865299706..99e5751634 100644
--- a/src/prevector.h
+++ b/src/prevector.h
@@ -196,11 +196,7 @@ private:
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);
}