mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
refactor: Add missing default constructor to prevector iterators
This commit is contained in:
parent
03c5b0064d
commit
facaa66b49
1 changed files with 8 additions and 4 deletions
|
@ -47,13 +47,14 @@ public:
|
|||
typedef const value_type* const_pointer;
|
||||
|
||||
class iterator {
|
||||
T* ptr;
|
||||
T* ptr{};
|
||||
public:
|
||||
typedef Diff difference_type;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
iterator() = default;
|
||||
iterator(T* ptr_) : ptr(ptr_) {}
|
||||
T& operator*() const { return *ptr; }
|
||||
T* operator->() const { return ptr; }
|
||||
|
@ -77,13 +78,14 @@ public:
|
|||
};
|
||||
|
||||
class reverse_iterator {
|
||||
T* ptr;
|
||||
T* ptr{};
|
||||
public:
|
||||
typedef Diff difference_type;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
reverse_iterator() = default;
|
||||
reverse_iterator(T* ptr_) : ptr(ptr_) {}
|
||||
T& operator*() { return *ptr; }
|
||||
const T& operator*() const { return *ptr; }
|
||||
|
@ -98,13 +100,14 @@ public:
|
|||
};
|
||||
|
||||
class const_iterator {
|
||||
const T* ptr;
|
||||
const T* ptr{};
|
||||
public:
|
||||
typedef Diff difference_type;
|
||||
typedef const T value_type;
|
||||
typedef const T* pointer;
|
||||
typedef const T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
const_iterator() = default;
|
||||
const_iterator(const T* ptr_) : ptr(ptr_) {}
|
||||
const_iterator(iterator x) : ptr(&(*x)) {}
|
||||
const T& operator*() const { return *ptr; }
|
||||
|
@ -128,13 +131,14 @@ public:
|
|||
};
|
||||
|
||||
class const_reverse_iterator {
|
||||
const T* ptr;
|
||||
const T* ptr{};
|
||||
public:
|
||||
typedef Diff difference_type;
|
||||
typedef const T value_type;
|
||||
typedef const T* pointer;
|
||||
typedef const T& reference;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
const_reverse_iterator() = default;
|
||||
const_reverse_iterator(const T* ptr_) : ptr(ptr_) {}
|
||||
const_reverse_iterator(reverse_iterator x) : ptr(&(*x)) {}
|
||||
const T& operator*() const { return *ptr; }
|
||||
|
|
Loading…
Add table
Reference in a new issue