folly::exception_wrapper::with_exception

Call fn with the wrapped exception (if any), if fn can accept it.

Synopses

Declared in <folly/ExceptionWrapper.h>

Call fn with the wrapped exception (if any), if fn can accept it.

template<
    class Ex = void const,
    class Fn>
bool
with_exception(Fn fn);
» more...
template<
    class Ex = void const,
    class Fn>
bool
with_exception(Fn fn) const;
» more...

Return Value

true if and only if fn was called.

Template Parameters

NameDescription
ExOptionally, the type of the exception that fn accepts.
FnThe type of a monomorphic function object.

Parameters

NameDescription
fnA function object to call with the wrapped exception