[libcxx-commits] [libcxx] [libc++] Optimize std::swap of locales (PR #209760)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 29 07:29:07 PDT 2026


================
@@ -143,8 +143,14 @@ private:
   friend bool has_facet(const locale&) _NOEXCEPT;
   template <class _Facet>
   friend const _Facet& use_facet(const locale&);
+
+  friend void swap(locale&, locale&);
 };
 
+inline void swap(locale& __lhs, locale& __rhs) {
----------------
ldionne wrote:

Ah, right, I missed the fact that this changes the behavior of move from being bad to being good, but that's also breaking.

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


More information about the libcxx-commits mailing list