[libcxx-commits] [PATCH] D119958: Remove __uncvref; use __uncvref_t instead

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 17 08:04:34 PST 2022


Quuxplusone added inline comments.


================
Comment at: libcxx/include/future:1891-1896
     template <class _Fp, class _Allocator,
-              class = typename enable_if
-              <
-                  !is_same<
-                      typename __uncvref<_Fp>::type,
-                      packaged_task
-                      >::value
-                  >::type
-              >
+              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
         _LIBCPP_INLINE_VISIBILITY
         packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
              : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
                __p_(allocator_arg, __a) {}
----------------
Looks like there's a test that depends on using `typename enable_if<...>::type` here. Either replace `__enable_if_t` with `enable_if<...>::type`, or (AFAIconcerned) just refactor that test
```
libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp 
```
to be a compile.pass.cpp that simply checks `std::is_constructible<std::packaged_task<...>, ...>::value` instead of expecting a particular error message from the compiler.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119958/new/

https://reviews.llvm.org/D119958



More information about the libcxx-commits mailing list