[libcxx-commits] [libcxx] [libc++] Optimize ranges::for_each for iterating over __trees (PR #164405)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 22 08:10:56 PDT 2025
================
@@ -1992,6 +2014,23 @@ multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
# endif
+# if _LIBCPP_STD_VER >= 14
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+struct __specialized_algorithm<_Algorithm::__for_each, multimap<_Key, _Tp, _Compare, _Allocator>> {
+ using __map _LIBCPP_NODEBUG = multimap<_Key, _Tp, _Compare, _Allocator>;
+
+ static const bool __has_algorithm = true;
+
+ // set's begin() and end() are identical with and without const qualifiaction
----------------
ldionne wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/164405
More information about the libcxx-commits
mailing list