X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FExceptionWrapper-inl.h;h=1d74c030d9fbd5e06e98ee4d9b44e956d6731409;hb=HEAD;hp=7a965525aee302cc0f1f154174bbb41de4a0198a;hpb=6139d03f90efd6d59f524d773db856d171a265ac;p=folly.git diff --git a/folly/ExceptionWrapper-inl.h b/folly/ExceptionWrapper-inl.h index 7a965525..1d74c030 100644 --- a/folly/ExceptionWrapper-inl.h +++ b/folly/ExceptionWrapper-inl.h @@ -281,12 +281,27 @@ inline exception_wrapper exception_wrapper::SharedPtr::get_exception_ptr_( } template -inline exception_wrapper::exception_wrapper(OnHeapTag, in_place_type_t, As&&... as) +inline exception_wrapper::exception_wrapper( + ThrownTag, + in_place_type_t, + As&&... as) + : eptr_{std::make_exception_ptr(Ex(std::forward(as)...)), + reinterpret_cast(std::addressof(typeid(Ex))) + 1u}, + vptr_(&ExceptionPtr::ops_) {} + +template +inline exception_wrapper::exception_wrapper( + OnHeapTag, + in_place_type_t, + As&&... as) : sptr_{std::make_shared>(std::forward(as)...)}, vptr_(&SharedPtr::ops_) {} template -inline exception_wrapper::exception_wrapper(InSituTag, in_place_type_t, As&&... as) +inline exception_wrapper::exception_wrapper( + InSituTag, + in_place_type_t, + As&&... as) : buff_{in_place_type, std::forward(as)...}, vptr_(&InPlace::ops_) {} @@ -335,7 +350,7 @@ Ex&& dont_slice(Ex&& ex) { "be sliced when storing in exception_wrapper."); return std::forward(ex); } -} +} // namespace exception_wrapper_detail template < class Ex,