[PATCH] Define std::__invoke_r for INVOKE<R>
Jonathan Wakely
jwakely@redhat.com
Fri May 17 09:29:00 GMT 2019
On 17/05/19 10:15 +0100, Jonathan Wakely wrote:
>I'm testing the attached fix. Thanks for the report.
Tests passed, patch committed to trunk.
>commit 6ae6283255f58ad44a159970dce6f431cf46f293
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date: Fri May 17 10:10:10 2019 +0100
>
> Fix __invoke_r<void> to be valid in C++11
>
> * include/bits/invoke.h [__cplusplus < 201703L] (__invoke_r<void>):
> Use _GLIBCXX14_CONSTEXPR because void functions cannot be constexpr
> in C++11.
>
>diff --git a/libstdc++-v3/include/bits/invoke.h b/libstdc++-v3/include/bits/invoke.h
>index 59e22da84d4..b2e9eee1a48 100644
>--- a/libstdc++-v3/include/bits/invoke.h
>+++ b/libstdc++-v3/include/bits/invoke.h
>@@ -144,7 +144,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>
> // INVOKE<R> when R is cv void
> template<typename _Res, typename _Callable, typename... _Args>
>- constexpr __can_invoke_as_void<_Res, _Callable, _Args...>
>+ _GLIBCXX14_CONSTEXPR __can_invoke_as_void<_Res, _Callable, _Args...>
> __invoke_r(_Callable&& __fn, _Args&&... __args)
> {
> using __result = __invoke_result<_Callable, _Args...>;
More information about the Libstdc++
mailing list