Skip to content

Commit d5dc9e7

Browse files
committed
Make * return the reference type
1 parent 1663ef6 commit d5dc9e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/poolstl/iota_iter.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace poolstl {
3737
using value_type = T;
3838
using difference_type = std::ptrdiff_t;
3939
using pointer = T *;
40-
using reference = T &;
40+
using reference = T;
4141
using iterator_category = std::random_access_iterator_tag;
4242

4343
iota_iter() : value{} {}
@@ -47,8 +47,8 @@ namespace poolstl {
4747
iota_iter<T> &operator=(T rhs) { value = rhs; return *this; }
4848
iota_iter<T> &operator=(const iota_iter &rhs) { value = rhs.value; return *this; }
4949

50-
T operator*() const { return value; }
51-
T operator[](difference_type rhs) const { return value + rhs; }
50+
reference operator*() const { return value; }
51+
reference operator[](difference_type rhs) const { return value + rhs; }
5252
// operator-> has no meaning in this application
5353

5454
bool operator==(const iota_iter<T> &rhs) const { return value == rhs.value; }

0 commit comments

Comments
 (0)