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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 10 06:01:11 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)) {}
----------------
ldionne wrote:

Ah, what I was missing is that this is only enabled in C++11 and C++14. That does reduce the likelihood of Hyrum's law biting us.

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


More information about the libcxx-commits mailing list