X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FExceptionWrapper.h;h=82dfde723ee71cf8d66e3cae3907a5d0650b2f53;hb=b3e7df8220f410398011fea71b280ba8be459fcc;hp=a1adfecdd3763110c8a9f0f0cab86bf9ee74027f;hpb=59c1b560c01761fe3993d2a376a529f2a55edff7;p=folly.git diff --git a/folly/ExceptionWrapper.h b/folly/ExceptionWrapper.h index a1adfecd..82dfde72 100644 --- a/folly/ExceptionWrapper.h +++ b/folly/ExceptionWrapper.h @@ -457,6 +457,18 @@ class exception_wrapper final { //! \overload std::exception const* get_exception() const noexcept; + //! \returns a pointer to the `Ex` held by `*this`, if it holds an object + //! whose type `From` permits `std::is_convertible`; + //! otherwise, returns `nullptr`. + //! \note This function does not mutate the `exception_wrapper` object. + //! \note This function may cause an exception to be thrown and immediately + //! caught internally, affecting runtime performance. + template + Ex* get_object() noexcept; + //! \overload + template + Ex const* get_object() const noexcept; + //! \return A `std::exception_ptr` that references either the exception held //! by `*this`, or a copy of same. //! \note This function may need to throw an exception to complete the action.