Skip to content

Commit d444441

Browse files
author
MarcoFalke
committed
refactor: Allow CScript construction from any std::input_iterator
Also, remove the value_type alias, which is not needed when element_type is present.
1 parent 66114cd commit d444441

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/prevector.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class prevector {
5050
T* ptr{};
5151
public:
5252
typedef Diff difference_type;
53-
typedef T value_type;
5453
typedef T* pointer;
5554
typedef T& reference;
5655
using element_type = T;
@@ -102,7 +101,6 @@ class prevector {
102101
const T* ptr{};
103102
public:
104103
typedef Diff difference_type;
105-
typedef const T value_type;
106104
typedef const T* pointer;
107105
typedef const T& reference;
108106
using element_type = const T;

src/script/script.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ class CScript : public CScriptBase
429429
}
430430
return *this;
431431
}
432+
432433
public:
433434
CScript() = default;
434-
CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { }
435-
CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { }
436-
CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { }
435+
template <std::input_iterator InputIterator>
436+
CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
437437

438438
SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
439439

0 commit comments

Comments
 (0)