mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -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;
|
typedef const value_type* const_pointer;
|
||||||
|
|
||||||
class iterator {
|
class iterator {
|
||||||
T* ptr;
|
T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef T* pointer;
|
typedef T* pointer;
|
||||||
typedef T& reference;
|
typedef T& reference;
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
typedef std::random_access_iterator_tag iterator_category;
|
||||||
|
iterator() = default;
|
||||||
iterator(T* ptr_) : ptr(ptr_) {}
|
iterator(T* ptr_) : ptr(ptr_) {}
|
||||||
T& operator*() const { return *ptr; }
|
T& operator*() const { return *ptr; }
|
||||||
T* operator->() const { return ptr; }
|
T* operator->() const { return ptr; }
|
||||||
|
@ -77,13 +78,14 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class reverse_iterator {
|
class reverse_iterator {
|
||||||
T* ptr;
|
T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef T* pointer;
|
typedef T* pointer;
|
||||||
typedef T& reference;
|
typedef T& reference;
|
||||||
typedef std::bidirectional_iterator_tag iterator_category;
|
typedef std::bidirectional_iterator_tag iterator_category;
|
||||||
|
reverse_iterator() = default;
|
||||||
reverse_iterator(T* ptr_) : ptr(ptr_) {}
|
reverse_iterator(T* ptr_) : ptr(ptr_) {}
|
||||||
T& operator*() { return *ptr; }
|
T& operator*() { return *ptr; }
|
||||||
const T& operator*() const { return *ptr; }
|
const T& operator*() const { return *ptr; }
|
||||||
|
@ -98,13 +100,14 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class const_iterator {
|
class const_iterator {
|
||||||
const T* ptr;
|
const T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef const T value_type;
|
typedef const T value_type;
|
||||||
typedef const T* pointer;
|
typedef const T* pointer;
|
||||||
typedef const T& reference;
|
typedef const T& reference;
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
typedef std::random_access_iterator_tag iterator_category;
|
||||||
|
const_iterator() = default;
|
||||||
const_iterator(const T* ptr_) : ptr(ptr_) {}
|
const_iterator(const T* ptr_) : ptr(ptr_) {}
|
||||||
const_iterator(iterator x) : ptr(&(*x)) {}
|
const_iterator(iterator x) : ptr(&(*x)) {}
|
||||||
const T& operator*() const { return *ptr; }
|
const T& operator*() const { return *ptr; }
|
||||||
|
@ -128,13 +131,14 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class const_reverse_iterator {
|
class const_reverse_iterator {
|
||||||
const T* ptr;
|
const T* ptr{};
|
||||||
public:
|
public:
|
||||||
typedef Diff difference_type;
|
typedef Diff difference_type;
|
||||||
typedef const T value_type;
|
typedef const T value_type;
|
||||||
typedef const T* pointer;
|
typedef const T* pointer;
|
||||||
typedef const T& reference;
|
typedef const T& reference;
|
||||||
typedef std::bidirectional_iterator_tag iterator_category;
|
typedef std::bidirectional_iterator_tag iterator_category;
|
||||||
|
const_reverse_iterator() = default;
|
||||||
const_reverse_iterator(const T* ptr_) : ptr(ptr_) {}
|
const_reverse_iterator(const T* ptr_) : ptr(ptr_) {}
|
||||||
const_reverse_iterator(reverse_iterator x) : ptr(&(*x)) {}
|
const_reverse_iterator(reverse_iterator x) : ptr(&(*x)) {}
|
||||||
const T& operator*() const { return *ptr; }
|
const T& operator*() const { return *ptr; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue