[libcxx-commits] [libcxx] [libc++] Remove allocator support from std::function (PR #140395)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 8 07:43:36 PDT 2025


================
@@ -954,7 +784,7 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(std::move(__f)) {}
 #  if _LIBCPP_STD_VER <= 14
 template <class _Rp, class... _ArgTypes>
 template <class _Fp, class _Alloc, class>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a, _Fp __f) : __f_(std::move(__f), __a) {}
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, _Fp __f) : __f_(std::move(__f)) {}
----------------
philnik777 wrote:

This is the diff that makes it impossible to instantiate `__func` with anything but `std::allocator`.

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


More information about the libcxx-commits mailing list