diff --git a/src/prevector.h b/src/prevector.h index 6dcc305268f..0c47137910b 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -5,13 +5,13 @@ #ifndef BITCOIN_PREVECTOR_H #define BITCOIN_PREVECTOR_H -#include -#include -#include -#include - #include +#include #include +#include +#include +#include +#include #include #include @@ -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; @@ -212,7 +210,7 @@ private: std::fill_n(dst, count, value); } - template + template void fill(T* dst, InputIterator first, InputIterator last) { while (first != last) { new(static_cast(dst)) T(*first); @@ -231,7 +229,7 @@ public: fill(item_ptr(0), n, val); } - template + template void assign(InputIterator first, InputIterator last) { size_type n = last - first; clear(); @@ -254,7 +252,7 @@ public: fill(item_ptr(0), n, val); } - template + template prevector(InputIterator first, InputIterator last) { size_type n = last - first; change_capacity(n); @@ -383,7 +381,7 @@ public: fill(item_ptr(p), count, value); } - template + template void insert(iterator pos, InputIterator first, InputIterator last) { size_type p = pos - begin(); difference_type count = last - first; diff --git a/src/script/script.h b/src/script/script.h index 323411251c4..e3119cbe05f 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -429,11 +429,11 @@ protected: } return *this; } + public: CScript() = default; - CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { } - CScript(std::vector::const_iterator pbegin, std::vector::const_iterator pend) : CScriptBase(pbegin, pend) { } - CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { } + template + CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { } SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase(obj)); }