Skip to content

Commit fad74bb

Browse files
author
MarcoFalke
committed
refactor: Mark prevector iterator with std::contiguous_iterator_tag
1 parent fab8a01 commit fad74bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/prevector.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class prevector {
5353
typedef T value_type;
5454
typedef T* pointer;
5555
typedef T& reference;
56-
typedef std::random_access_iterator_tag iterator_category;
56+
using element_type = T;
57+
using iterator_category = std::contiguous_iterator_tag;
5758
iterator() = default;
5859
iterator(T* ptr_) : ptr(ptr_) {}
5960
T& operator*() const { return *ptr; }
@@ -104,7 +105,8 @@ class prevector {
104105
typedef const T value_type;
105106
typedef const T* pointer;
106107
typedef const T& reference;
107-
typedef std::random_access_iterator_tag iterator_category;
108+
using element_type = const T;
109+
using iterator_category = std::contiguous_iterator_tag;
108110
const_iterator() = default;
109111
const_iterator(const T* ptr_) : ptr(ptr_) {}
110112
const_iterator(iterator x) : ptr(&(*x)) {}

0 commit comments

Comments
 (0)