From facaa66b49ef7eeefe1d57c1bfc1bbe5b3011661 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 18 Jan 2024 15:19:49 +0100 Subject: refactor: Add missing default constructor to prevector iterators --- src/prevector.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/prevector.h b/src/prevector.h index bcab1ff00c..2152a3706f 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -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; } -- cgit v1.2.3