mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04: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:
parent
66114cd45b
commit
d444441900
2 changed files with 3 additions and 5 deletions
|
@ -50,7 +50,6 @@ public:
|
||||||
T* ptr{};
|
T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef T value_type;
|
|
||||||
typedef T* pointer;
|
typedef T* pointer;
|
||||||
typedef T& reference;
|
typedef T& reference;
|
||||||
using element_type = T;
|
using element_type = T;
|
||||||
|
@ -102,7 +101,6 @@ public:
|
||||||
const T* ptr{};
|
const T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef const T value_type;
|
|
||||||
typedef const T* pointer;
|
typedef const T* pointer;
|
||||||
typedef const T& reference;
|
typedef const T& reference;
|
||||||
using element_type = const T;
|
using element_type = const T;
|
||||||
|
|
|
@ -429,11 +429,11 @@ protected:
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CScript() = default;
|
CScript() = default;
|
||||||
CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { }
|
template <std::input_iterator InputIterator>
|
||||||
CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { }
|
CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
|
||||||
CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { }
|
|
||||||
|
|
||||||
SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
|
SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue