[libcxx-commits] [PATCH] D127159: [libc++] Simplify the char_traits specializations

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 9 13:26:57 PDT 2022


EricWF added inline comments.


================
Comment at: libcxx/include/__string/char_traits.h:529
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-    static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+    static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
+        std::copy_n(__s2, __n, __s1);
----------------
Don't we externally instantiate char_traits? This change would allow the compiler to instantiate and generate code in each TU for these functions. Maybe that's what we want, maybe that isn't. But we should consider it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127159/new/

https://reviews.llvm.org/D127159



More information about the libcxx-commits mailing list