8000 fix invoke for c++17 · arangodb/arangodb@127bb7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 127bb7d

Browse files
committed
fix invoke for c++17
1 parent 65a514c commit 127bb7d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/Futures/backports.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ std::function<R(Args ...)>,
6060
std::reference_wrapper<typename std::remove_reference<F>::type>
6161
>
6262
{};
63-
63+
6464
// mimic: std::invoke, C++17
6565
template <typename F, typename... Args>
6666
constexpr auto invoke(F&& f, Args&&... args) noexcept(noexcept(static_cast<F&&>(f)(static_cast<Args&&>(args)...)))
@@ -72,8 +72,8 @@ constexpr auto invoke(M(C::*d), Args&&... args)
7272
-> decltype(std::mem_fn(d)(static_cast<Args&&>(args)...)) {
7373
return std::mem_fn(d)(static_cast<Args&&>(args)...);
7474
}
75-
7675
#else
76+
using std::invoke;
7777
using in_place_t = std::in_place_t;
7878
inline constexpr in_place_t in_place{};
7979

@@ -82,11 +82,6 @@ using is_invocable_r = std::is_invocable_r<R, FN, ArgTypes...>;
8282

8383
template <class FN, class... ArgTypes>
8484
using is_invocable = std::is_invocable<FN, ArgTypes...>;
85-
86-
template< class F, class... Args>
87-
auto invoke(F&& f, Args&&... args) noexcept -> decltype(std::invoke(f, args...)) {
88-
return std::invoke(f, args...);
89-
}
9085
#endif
9186

9287
}}

0 commit comments

Comments
 (0)
0