From b9cce12e76796962e5e5ad0d5408370af56af459 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 24 May 2022 16:02:59 +0200 Subject: [PATCH] qxp::function_ref: drop use of q23::invoke_r Since P0792r8, pointers to members are no longer supported, which means we don't need to use std::invoke anymore. Remove std::invoke in favor of traditional function call syntax, which should be faster to compile, too. Change-Id: I2ec3888795471f345ded36bb564d35ac0de29068 Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/global/qxpfunctional.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qxpfunctional.h b/src/corelib/global/qxpfunctional.h index 67350c56ed..ca015be22e 100644 --- a/src/corelib/global/qxpfunctional.h +++ b/src/corelib/global/qxpfunctional.h @@ -21,7 +21,7 @@ // We mean it. // -#include +#include #include #include @@ -99,8 +99,7 @@ public: Q_IMPLICIT function_ref_base(F* f) noexcept : m_bound_entity(f), m_thunk_ptr([](BoundEntityType ctx, ArgTypes&&... args) noexcept(noex) -> R { - return q23::invoke_r(reinterpret_cast(ctx.fun), - std::forward(args)...); + return reinterpret_cast(ctx.fun)(std::forward(args)...); }) {} @@ -116,8 +115,7 @@ public: : m_bound_entity(std::addressof(f)), m_thunk_ptr([](BoundEntityType ctx, ArgTypes&&... args) noexcept(noex) -> R { using That = copy_const_t>; - return q23::invoke_r(*static_cast(ctx.obj), - std::forward(args)...); + return (*static_cast(ctx.obj))(std::forward(args)...); }) {}