Skip to content

Commit bc61883

Browse files
committed
fix typo
Signed-off-by: Martijn Govers <[email protected]>
1 parent ef80b20 commit bc61883

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/cpp_unit_tests/test_iterator_facade.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ template <typename UnderlyingType> class BaseTestIterator : public IteratorFacad
3838
return *this;
3939
}
4040
friend constexpr auto operator-(BaseTestIterator const& first, BaseTestIterator const& second) -> difference_type {
41-
return second.it_ - first.it_;
41+
return first.it_ - second.it_;
4242
}
4343

4444
private:
@@ -92,6 +92,8 @@ TEST_CASE_TEMPLATE("Test IteratorFacade", T, TestIdxVectorIterator, TestIdxVecto
9292
auto const it4 = TestIterator{vec.begin() + 15};
9393
dist = it2 - it4;
9494
CHECK(dist == 10);
95+
dist = it4 - it2;
96+
CHECK(dist == -10);
9597
}
9698
if constexpr (std::is_same_v<TestIterator, TestIdxVectorIterator>) {
9799
SUBCASE("Mutate elements") {

0 commit comments

Comments
 (0)