[libcxx-commits] [libcxx] [libc++] Implement LWG3476: Add mandates to thread, jthread, and async (PR #173363)

Marcell Leleszi via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 23 23:36:28 PST 2025


================
@@ -1847,15 +1849,20 @@ inline _LIBCPP_HIDE_FROM_ABI bool __does_policy_contain(launch __policy, launch
 template <class _Fp, class... _Args>
 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<__invoke_result_t<__decay_t<_Fp>, __decay_t<_Args>...> >
 async(launch __policy, _Fp&& __f, _Args&&... __args) {
+#      if _LIBCPP_STD_VER >= 17
+  static_assert(is_constructible_v<__decay_t<_Fp>, _Fp>);
+  static_assert((is_constructible_v<__decay_t<_Args>, _Args> && ...));
+  static_assert(is_invocable_v<__decay_t<_Fp>, __decay_t<_Args>...>);
+#      endif
----------------
mleleszi wrote:

Done

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


More information about the libcxx-commits mailing list