mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 02:11:24 +02:00
Implement prevector::fill once
Now that the implementation is identical, we can use a default value to distinguish them.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user