Fix ExceptionWrapper::with_exception to support lvalue ref functors
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 26 Nov 2015 05:48:38 +0000 (21:48 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Thu, 26 Nov 2015 06:20:20 +0000 (22:20 -0800)
commitf0a9aafc8048ea62866c26ef6623834c7824ea4c
tree51d68689a7990174a39be37322cb72ff18dfac37
parent596aa8952f0afec207e876bd99dcb4f4841a9aef
Fix ExceptionWrapper::with_exception to support lvalue ref functors

Summary: [Folly] Fix `ExceptionWrapper::with_exception` to support lvalue ref functors.

Ex:

    auto handler = [&](const std::runtime_error& e) { handle_runtime_error(e); };
    exception_wrapper wrap = get_some_exception_wrapper_from_context();
    wrap.with_exception(handler); // broken before this diff, fixed after

Reviewed By: markisaa

Differential Revision: D2698680

fb-gh-sync-id: 4976ba08e3601e22891d00d79a5dae5118887b71
folly/ExceptionWrapper.h
folly/test/ExceptionWrapperTest.cpp