Merge pull request #4994 from edge90:fix/onceaction-tuple-sfinae-order
PiperOrigin-RevId: 953630264 Change-Id: Iad16b5ee9a92ccb6b580733be18dbeb85371e66d
This commit is contained in:
@@ -427,21 +427,20 @@ class [[nodiscard]] OnceAction<Result(Args...)> final {
|
|||||||
// via StdFunctionAdaptor.
|
// via StdFunctionAdaptor.
|
||||||
template <typename Callable>
|
template <typename Callable>
|
||||||
using IsDirectlyCompatible = internal::conjunction<
|
using IsDirectlyCompatible = internal::conjunction<
|
||||||
// It must be possible to capture the callable in StdFunctionAdaptor.
|
|
||||||
std::is_constructible<typename std::decay<Callable>::type, Callable>,
|
|
||||||
// The callable must be compatible with our signature.
|
// The callable must be compatible with our signature.
|
||||||
internal::is_callable_r<Result, typename std::decay<Callable>::type,
|
internal::is_callable_r<Result, std::decay_t<Callable>, Args...>,
|
||||||
Args...>>;
|
// It must be possible to capture the callable in StdFunctionAdaptor.
|
||||||
|
std::is_constructible<std::decay_t<Callable>, Callable>>;
|
||||||
|
|
||||||
// True iff we can use the given callable type via StdFunctionAdaptor once we
|
// True iff we can use the given callable type via StdFunctionAdaptor once we
|
||||||
// ignore incoming arguments.
|
// ignore incoming arguments.
|
||||||
template <typename Callable>
|
template <typename Callable>
|
||||||
using IsCompatibleAfterIgnoringArguments = internal::conjunction<
|
using IsCompatibleAfterIgnoringArguments = internal::conjunction<
|
||||||
// It must be possible to capture the callable in a lambda.
|
|
||||||
std::is_constructible<typename std::decay<Callable>::type, Callable>,
|
|
||||||
// The callable must be invocable with zero arguments, returning something
|
// The callable must be invocable with zero arguments, returning something
|
||||||
// convertible to Result.
|
// convertible to Result.
|
||||||
internal::is_callable_r<Result, typename std::decay<Callable>::type>>;
|
internal::is_callable_r<Result, std::decay_t<Callable>>,
|
||||||
|
// It must be possible to capture the callable in a lambda.
|
||||||
|
std::is_constructible<std::decay_t<Callable>, Callable>>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Construct from a callable that is directly compatible with our mocked
|
// Construct from a callable that is directly compatible with our mocked
|
||||||
|
|||||||
Reference in New Issue
Block a user