[libcxx-commits] [libcxx] [libc++][NFC] Use __constexpr_memmove instead of copy_n in <__string/char_traits.h> (PR #85920)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 21 03:56:43 PDT 2024


philnik777 wrote:

> LGTM. However, generally speaking I would be careful about not blindly removing useful layers of abstraction just to reduce compilation times. I'm not saying that's what this patch is doing, just warning that it might be easy to fall in that trap.

I absolutely agree. I've been thinking about whether this is worth it for a while. If `__constexpr_memmove` didn't already exist and have almost the same API as `copy_n` I almost certainly wouldn't have considered this. In most cases it's also not that much of a concern, since most of our code is templated and thus doesn't instantiate its dependencies unconditionally.

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


More information about the libcxx-commits mailing list