[libcxx-commits] [libcxx] [libc++] Avoid double comparisons when uniquing flat_set/flat_map (PR #214118)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 4 20:10:14 PDT 2026


================
@@ -938,13 +938,30 @@ class flat_map {
     return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);
   }
 
+  template <class _Iter, class _Sent, class _Predicate>
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static _Iter
----------------
frederick-vs-ja wrote:

Functions with internal linkage ("global `static` functions") in headers are problematic. They may cause exposure of TU-local entity and potential ODR-violation.

https://github.com/llvm/llvm-project/pull/214118


More information about the libcxx-commits mailing list