0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

refactor: Allow CScript construction from any std::input_iterator

Also, remove the value_type alias, which is not needed when element_type
is present.
This commit is contained in:
MarcoFalke 2024-02-02 11:35:23 +01:00
parent 66114cd45b
commit d444441900
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View file

@ -50,7 +50,6 @@ public:
T* ptr{};
public:
typedef Diff difference_type;
typedef T value_type;
typedef T* pointer;
typedef T& reference;
using element_type = T;
@ -102,7 +101,6 @@ public:
const T* ptr{};
public:
typedef Diff difference_type;
typedef const T value_type;
typedef const T* pointer;
typedef const T& reference;
using element_type = const T;

View file

@ -429,11 +429,11 @@ protected:
}
return *this;
}
public:
CScript() = default;
CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { }
CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { }
CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { }
template <std::input_iterator InputIterator>
CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }