mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
refactor: Mark prevector iterator with std::contiguous_iterator_tag
This commit is contained in:
parent
fab8a01048
commit
fad74bbbd0
1 changed files with 4 additions and 2 deletions
|
@ -53,7 +53,8 @@ public:
|
||||||
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;
|
using element_type = T;
|
||||||
|
using iterator_category = std::contiguous_iterator_tag;
|
||||||
iterator() = default;
|
iterator() = default;
|
||||||
iterator(T* ptr_) : ptr(ptr_) {}
|
iterator(T* ptr_) : ptr(ptr_) {}
|
||||||
T& operator*() const { return *ptr; }
|
T& operator*() const { return *ptr; }
|
||||||
|
@ -104,7 +105,8 @@ public:
|
||||||
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;
|
using element_type = const T;
|
||||||
|
using iterator_category = std::contiguous_iterator_tag;
|
||||||
const_iterator() = default;
|
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)) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue