From 69ca48717ceb31e37e90276278362c809cf98cc6 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Tue, 13 Nov 2018 04:15:27 -0500 Subject: [PATCH] Implement prevector::fill once Now that the implementation is identical, we can use a default value to distinguish them. --- src/prevector.h | 6 +----- 1 file changed, 1 insertion(+), 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); }