Skip to content

Commit

Permalink
Drop the std::bind_front substitute for older Apple Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Jun 27, 2023
1 parent 077b664 commit 4144599
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Quotient/qt_connection_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,9 @@ inline auto connectSingleShot(auto* sender, auto signal, ContextT* context,
// In case of classic Qt pointer-to-member-function slots the receiver
// object has to be pre-bound to the slot to make it self-contained
if constexpr (_impl::PmfSlot<SlotT, ContextT>) {
auto&& boundSlot =
# if __cpp_lib_bind_front // Needs Apple Clang 13 (other platforms are fine)
std::bind_front(slot, context);
# else
[context, slot](const auto&... args)
requires requires { (context->*slot)(args...); }
{
(context->*slot)(args...);
};
# endif
return _impl::connect<_impl::SingleShot>(
sender, signal, context,
std::forward<decltype(boundSlot)>(boundSlot), connType);
return _impl::connect<_impl::SingleShot>(sender, signal, context,
std::bind_front(slot, context),
connType);
} else {
return _impl::connect<_impl::SingleShot>(sender, signal, context, slot,
connType);
Expand Down

0 comments on commit 4144599

Please sign in to comment.