[PATCH] Implement LWG 3062, Unnecessary decay_t in is_execution_policy_v

Jonathan Wakely jwakely@redhat.com
Wed Apr 24 23:08:00 GMT 2019


On 24/04/19 16:01 -0700, Thomas Rodgers wrote:
>
>	should be remove_cvref_t
>	* include/pstl/execution_defs.h (__enable_if_execution_policy):
>        Use std::__remove_cv_ref_t when building with GCC
>

>From cb7bd9a39acacbf81df0d03da8714fa463057cc5 Mon Sep 17 00:00:00 2001
>From: Thomas Rodgers <trodgers@redhat.com>
>Date: Wed, 24 Apr 2019 15:53:45 -0700
>Subject: [PATCH] Implement LWG 3062, Unnecessary decay_t in
> is_execution_policy_v
>
>	should be remove_cvref_t
>	* include/pstl/execution_defs.h (__enable_if_execution_policy):
>        Use std::__remove_cv_ref_t when building with GCC.
>---
> libstdc++-v3/include/pstl/execution_defs.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/libstdc++-v3/include/pstl/execution_defs.h b/libstdc++-v3/include/pstl/execution_defs.h
>index 86c7a5a770d..9b9b212b1bd 100644
>--- a/libstdc++-v3/include/pstl/execution_defs.h
>+++ b/libstdc++-v3/include/pstl/execution_defs.h
>@@ -152,9 +152,15 @@ constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<_T
> namespace __internal
> {
> template <class _ExecPolicy, class _T>
>+#if __GNUC__

Clang and Intel both define that macro, but that doesn't mean
__remove_cvref_t is available. I think you want __GLIBCXX__ to tell
that libstdc++ is in use, or better still:

#if _GLIBCXX_RELEASE >= 9

>+using __enable_if_execution_policy =
>+    typename std::enable_if<__pstl::execution::is_execution_policy<typename std::__remove_cvref_t<_ExecPolicy>>::value,

The typename before std::__remove_cvref_t shouldn't be there.

>+                            _T>::type;
>+#else
> using __enable_if_execution_policy =
>     typename std::enable_if<__pstl::execution::is_execution_policy<typename std::decay<_ExecPolicy>::type>::value,
>                             _T>::type;
>+#endif
> } // namespace __internal
> 
> } // namespace __pstl
>-- 
>2.20.1
>



More information about the Libstdc++ mailing list