Skip to content

Commit fa7b9b9

Browse files
author
MarcoFalke
committed
refactor: Require std::input_iterator for all InputIterator in prevector
1 parent d444441 commit fa7b9b9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/prevector.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#ifndef BITCOIN_PREVECTOR_H
66
#define BITCOIN_PREVECTOR_H
77

8-
#include <assert.h>
9-
#include <cstdlib>
10-
#include <stdint.h>
11-
#include <string.h>
12-
138
#include <algorithm>
9+
#include <cassert>
1410
#include <cstddef>
11+
#include <cstdint>
12+
#include <cstdlib>
13+
#include <cstring>
14+
#include <iterator>
1515
#include <type_traits>
1616
#include <utility>
1717

@@ -210,7 +210,7 @@ class prevector {
210210
std::fill_n(dst, count, value);
211211
}
212212

213-
template<typename InputIterator>
213+
template <std::input_iterator InputIterator>
214214
void fill(T* dst, InputIterator first, InputIterator last) {
215215
while (first != last) {
216216
new(static_cast<void*>(dst)) T(*first);
@@ -229,7 +229,7 @@ class prevector {
229229
fill(item_ptr(0), n, val);
230230
}
231231

232-
template<typename InputIterator>
232+
template <std::input_iterator InputIterator>
233233
void assign(InputIterator first, InputIterator last) {
234234
size_type n = last - first;
235235
clear();
@@ -252,7 +252,7 @@ class prevector {
252252
fill(item_ptr(0), n, val);
253253
}
254254

255-
template<typename InputIterator>
255+
template <std::input_iterator InputIterator>
256256
prevector(InputIterator first, InputIterator last) {
257257
size_type n = last - first;
258258
change_capacity(n);
@@ -381,7 +381,7 @@ class prevector {
381381
fill(item_ptr(p), count, value);
382382
}
383383

384-
template<typename InputIterator>
384+
template <std::input_iterator InputIterator>
385385
void insert(iterator pos, InputIterator first, InputIterator last) {
386386
size_type p = pos - begin();
387387
difference_type count = last - first;

0 commit comments

Comments
 (0)