[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 04:46:58 PST 2025


================
@@ -205,6 +207,12 @@ class _LIBCPP_EXPORTED_FROM_ABI thread {
 #  ifndef _LIBCPP_CXX03_LANG
   template <class _Fp, class... _Args, __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI explicit thread(_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