[libcxx-commits] [libcxx] 62da805 - [libc++] Add a release note about multi{map, set}::find not returning the first element anymore (#155252)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 25 23:00:16 PDT 2025
Author: Nikolas Klauser
Date: 2025-08-26T08:00:13+02:00
New Revision: 62da805f48ffaad5d479c7158908f8ec49848ce4
URL: https://github.com/llvm/llvm-project/commit/62da805f48ffaad5d479c7158908f8ec49848ce4
DIFF: https://github.com/llvm/llvm-project/commit/62da805f48ffaad5d479c7158908f8ec49848ce4.diff
LOG: [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.
Added:
Modified:
libcxx/docs/ReleaseNotes/22.rst
Removed:
################################################################################
diff --git a/libcxx/docs/ReleaseNotes/22.rst b/libcxx/docs/ReleaseNotes/22.rst
index 13d663e2bcda1..d341cc095980b 100644
--- a/libcxx/docs/ReleaseNotes/22.rst
+++ b/libcxx/docs/ReleaseNotes/22.rst
@@ -62,6 +62,8 @@ Deprecations and Removals
Potentially breaking changes
----------------------------
+- 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.
+
Announcements About Future Releases
-----------------------------------
More information about the libcxx-commits
mailing list