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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 20 06:32:34 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:

Sorry, I might be missing something extremely obvious but how is the existence of a move constructor observable here, since there's already a copy constructor?

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


More information about the libcxx-commits mailing list