Heads-up: std::multimap::find(), std::multiset::find() are changing behavior

43 views
Skip to first unread message

Nico Weber

unread,
Aug 27, 2025, 7:48:43 AM (10 days ago) Aug 27
to Chromium-dev
Hi,

std::multimap::find(key), std::multiset::find(key) used to return the first element equal to `key`. libc++ is changing so that it now returns any arbitrary element equal to key.

If you know of code that:
* Uses std::multimap or std::multiset
* Calls find() on it
* Iterates over the result

please check that it still works when find() returns an arbitrary matching element. (If not, switch to lower_bound() or equal_range().)

I tried going through all our code and fixing issues, but it's possible I missed something. (I did update everything covered by tests failing with the new libc++ revision.)

The bug for this is crbug.com/441317299

Thanks,
Nico
Reply all
Reply to author
Forward
0 new messages