Skip to content

Commit 62da805

Browse files
authored
[libc++] Add a release note about multi{map,set}::find not returning the first element anymore (#155252)
We've modified the algorithm of `__tree::find` in #152370, which can change the return value. Since we're always returned the lower bound before some users started relying on it. This patch adds a release note so users are aware that this might break their code.
1 parent 7d35e29 commit 62da805

File tree

1 file changed

+2
-0
lines changed
  • libcxx/docs/ReleaseNotes

1 file changed

+2
-0
lines changed

libcxx/docs/ReleaseNotes/22.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Deprecations and Removals
6262
Potentially breaking changes
6363
----------------------------
6464

65+
- The algorithm for ``multi{map,set}::find`` has been modified such that it doesn't necessarily return an iterator to the first equal element in the container. This was never guaranteed by the Standard, but libc++ previously happened to always return the first equal element, like other implementations do. Starting with this release, code relying on the first element being returned from ``find`` will be broken, and ``lower_bound`` or ``equal_range`` should be used instead.
66+
6567
Announcements About Future Releases
6668
-----------------------------------
6769

0 commit comments

Comments
 (0)