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 <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
29b65c98e7
commit
b9cce12e76
@ -21,7 +21,7 @@
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/q23functional.h>
|
||||
#include <QtCore/q20functional.h>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
@ -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<R>(reinterpret_cast<F*>(ctx.fun),
|
||||
std::forward<ArgTypes>(args)...);
|
||||
return reinterpret_cast<F*>(ctx.fun)(std::forward<ArgTypes>(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<Const, std::remove_reference_t<F>>;
|
||||
return q23::invoke_r<R>(*static_cast<That*>(ctx.obj),
|
||||
std::forward<ArgTypes>(args)...);
|
||||
return (*static_cast<That*>(ctx.obj))(std::forward<ArgTypes>(args)...);
|
||||
})
|
||||
{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user