[libcxx-commits] [libcxx] [libc++] Specialize allocator_traits for std::allocator (PR #160278)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 28 08:14:17 PST 2026


================
@@ -338,6 +339,80 @@ struct allocator_traits {
   }
 };
 
+template <class _Tp>
+struct allocator_traits<allocator<_Tp> > {
+  using allocator_type                         = allocator<_Tp>;
----------------
ldionne wrote:

I would suggest that we refactor these typedefs into a base class that we then specialize for `std::allocator`. That way, we get the same savings (assuming you're right about their provenance) but with less code duplication.

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


More information about the libcxx-commits mailing list