Skip to content

Commit

Permalink
refactor: Mark prevector iterator with std::contiguous_iterator_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Jan 18, 2024
1 parent fab8a01 commit fad74bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/prevector.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class prevector {
typedef T value_type;
typedef T* pointer;
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(T* ptr_) : ptr(ptr_) {}
T& operator*() const { return *ptr; }
Expand Down Expand Up @@ -104,7 +105,8 @@ class prevector {
typedef const T value_type;
typedef const T* pointer;
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(const T* ptr_) : ptr(ptr_) {}
const_iterator(iterator x) : ptr(&(*x)) {}
Expand Down

0 comments on commit fad74bb

Please sign in to comment.