Summary:
[Folly] Move the guts of `try_and_catch` into a `detail` namespace.
Just a bit cleaner this way. Also, now we always slice before returning the derived object, so the derived type never escapes.
Reviewed By: luciang
Differential Revision:
D4361471
fbshipit-source-id:
5c9567d3c5480ee9943a85139b8f27ba3b9da2d6
template <typename... Exceptions>
class try_and_catch;
template <typename... Exceptions>
class try_and_catch;
+}
+
+template <typename... Exceptions, typename F>
+exception_wrapper try_and_catch(F&& fn) {
+ return detail::try_and_catch<Exceptions...>(std::forward<F>(fn));
+} // detail