[libcxx-commits] [libcxx] [libc++] Optimize vector growing of trivially relocatable types (PR #76657)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Dec 31 05:56:24 PST 2023
================
@@ -45,6 +47,10 @@ class _LIBCPP_TEMPLATE_VIS allocator;
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_string;
+// TODO: This could be extended to also allow custom allocators and possibly custom chars and char traits
+template <class _CharT>
+struct __libcpp_is_trivially_relocatable<basic_string<_CharT>> : is_fundamental<_CharT> {};
----------------
mordante wrote:
We shouldn't allow all fundamental types as a `basic_string` specialization. Please limit it to the character types.
https://github.com/llvm/llvm-project/pull/76657
More information about the libcxx-commits
mailing list