diff --git a/include/sparta/FlatSet.h b/include/sparta/FlatSet.h index 1935102..baa5da0 100644 --- a/include/sparta/FlatSet.h +++ b/include/sparta/FlatSet.h @@ -190,7 +190,6 @@ class FlatSet final if (it != end && Equal()(*it, *other_it)) { it = m_set.erase(it); end = m_set.end(); - ++it; } ++other_it; } diff --git a/test/SetTest.cpp b/test/SetTest.cpp index 5fb8b04..5532812 100644 --- a/test/SetTest.cpp +++ b/test/SetTest.cpp @@ -178,6 +178,11 @@ TYPED_TEST(UInt32SetTest, basicOperations) { TypeParam d43 = t4.get_difference_with(t3); EXPECT_THAT(d43, ::testing::UnorderedElementsAre(0, 1, 5, 101, 8137, 1234567)); + + std::vector elements5 = {1, 2, 1023, 4096, 13001, bigint}; + TypeParam t5(elements5.begin(), elements5.end()); + TypeParam d54 = t5.get_difference_with(t4); + EXPECT_THAT(d54, ::testing::UnorderedElementsAre(1023, 13001)); } TYPED_TEST(UInt32SetTest, robustness) {