Skip to content

Commit 2d1cf88

Browse files
satisfy input_iterator and indirectly_readable
1 parent b1e4e0f commit 2d1cf88

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

libs/libvtrutil/src/vtr_strong_id_range.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class StrongIdIterator {
4646
using difference_type = ssize_t;
4747

4848
///@brief Dereference operator (*)
49-
StrongId& operator*() {
49+
StrongId operator*() const {
5050
VTR_ASSERT_SAFE(bool(id_));
51-
return this->id_;
51+
return id_;
5252
}
5353

5454
///@brief += operator
@@ -75,6 +75,14 @@ class StrongIdIterator {
7575
return *this;
7676
}
7777

78+
///@brief Post-increment operator
79+
StrongIdIterator operator++(int) {
80+
VTR_ASSERT_SAFE(bool(id_));
81+
StrongIdIterator temp = *this; // Create a copy of the current object
82+
++(*this); // Use the pre-increment operator to increment
83+
return temp; // Return the copy
84+
}
85+
7886
///@brief Decremment operator
7987
StrongIdIterator& operator--() {
8088
VTR_ASSERT_SAFE(bool(id_));

0 commit comments

Comments
 (0)