[ADT] Avoid use of result_of_t in function_ref

It has bugs on some old libc++ versions and we don't need the power.
See https://reviews.llvm.org/D88977
This commit is contained in:
Sam McCall 2020-10-19 14:58:31 +02:00
parent c872faf6e0
commit 375f7a4160
1 changed files with 3 additions and 3 deletions

View File

@ -199,9 +199,9 @@ public:
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)) {}