gdbsupport: Replace gdb::invoke_result with std::invoke_result

Given that GDB now requires C++17, we can replace gdb::invoke_result
with std::invoke_result which is provided by <type_traits>.

This patch also removes gdbsupport/invoke-result.h as it is not used
anymore.

Change-Id: I7e567356d38d6b3d85d8797d61cfc83f6f933f22
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
Lancelot Six
2023-10-13 12:39:55 +00:00
parent 393be56421
commit 70d02be7e3
5 changed files with 10 additions and 48 deletions

View File

@@ -192,7 +192,7 @@
You can find unit tests covering the whole API in
unittests/function-view-selftests.c. */
#include "invoke-result.h"
#include <type_traits>
namespace gdb {
namespace fv_detail {
@@ -230,7 +230,7 @@ class function_view<Res (Args...)>
/* True if Func can be called with Args, and either the result is
Res, convertible to Res or Res is void. */
template<typename Callable,
typename Res2 = typename gdb::invoke_result<Callable &, Args...>::type>
typename Res2 = typename std::invoke_result<Callable &, Args...>::type>
struct IsCompatibleCallable : CompatibleReturnType<Res2, Res>
{};