diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index 022c506168..7a41fd6067 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -87,6 +87,7 @@ - Extract `iceoryx_hoofs/platform` into separate package `iceoryx_platform` [\#1615](https://github.com/eclipse-iceoryx/iceoryx/issues/1615) - `cxx::unique_ptr` is no longer nullable [\#1104](https://github.com/eclipse-iceoryx/iceoryx/issues/1104) - Use builder pattern in mutex [\#1036](https://github.com/eclipse-iceoryx/iceoryx/issues/1036) +- Change return type of `cxx::vector::erase` to bool [\#1662](https://github.com/eclipse-iceoryx/iceoryx/issues/1662) **Workflow:** @@ -461,3 +462,13 @@ .create(myMutex); myMutex->lock(); ``` + +24. Change return type of `cxx::vector::erase` from iterator to bool + + ```cpp + // before + auto* iter = myCxxVector.erase(myCxxVector.begin()); + + // after + bool success = myCxxVector.erase(myCxxVector.begin()); + ``` diff --git a/iceoryx_hoofs/test/moduletests/test_cxx_vector.cpp b/iceoryx_hoofs/test/moduletests/test_cxx_vector.cpp index cdbc7782e9..da845b59bd 100644 --- a/iceoryx_hoofs/test/moduletests/test_cxx_vector.cpp +++ b/iceoryx_hoofs/test/moduletests/test_cxx_vector.cpp @@ -912,6 +912,8 @@ TEST_F(vector_test, EraseFailsWhenElementIsInvalid) ::testing::Test::RecordProperty("TEST_ID", "ff7c1c4a-4ef5-4905-a107-6f1d27462d47"); auto* i = sut.begin() + 5U; EXPECT_FALSE(sut.erase(i)); + EXPECT_FALSE(sut.erase(sut.end())); + EXPECT_FALSE(sut.erase(sut.begin() - 1)); } TEST_F(vector_test, ErasingElementDecreasesSize)