It has bugs on some old libc++ versions and we don't need the power.
See https://reviews.llvm.org/D88977
function_ref>::value> * = nullptr,
// Functor must be callable and return a suitable type.
std::enable_if_t<std::is_void<Ret>::value ||
- std::is_convertible<
- std::result_of_t<Callable(Params...)>, Ret>::value>
- * = nullptr)
+ std::is_convertible<decltype(std::declval<Callable>()(
+ std::declval<Params>()...)),
+ Ret>::value> * = nullptr)
: callback(callback_fn<typename std::remove_reference<Callable>::type>),
callable(reinterpret_cast<intptr_t>(&callable)) {}