[PATCH] Implement LWG 3062, Unnecessary decay_t in is_execution_policy_v
Thomas Rodgers
trodgers@redhat.com
Tue May 21 22:18:00 GMT 2019
The revised attached patch has been ested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-LWG-3062-Unnecessary-decay_t-in-is_execution_policy_.patch
Type: text/x-patch
Size: 1876 bytes
Desc: Revised Patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190521/47764b13/attachment.bin>
-------------- next part --------------
Thomas Rodgers writes:
> Revised patch.
>
> From 074685cf74b48604244c0c6f1d8cba63ff8915e5 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..0ed4cc30914 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 _GLIBCXX_RELEASE >= 9
> +using __enable_if_execution_policy =
> + typename std::enable_if<__pstl::execution::is_execution_policy<std::__remove_cvref_t<_ExecPolicy>>::value,
> + _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
More information about the Libstdc++
mailing list