35 exception_dispatch_info() =
default;
36 exception_dispatch_info(exception_dispatch_info&&) =
default;
37 exception_dispatch_info(
const exception_dispatch_info&) =
default;
38 auto operator =(exception_dispatch_info&&) -> exception_dispatch_info& =
default;
39 auto operator =(
const exception_dispatch_info&) -> exception_dispatch_info& =
default;
47 [[nodiscard]]
auto exception_captured() const noexcept ->
bool {
return exception_ptr_ ? true :
false;}
63 template<
class exception_t>
64 requires std::derived_from<exception_t, xtd::exception>
65 [[nodiscard]]
static auto capture(
const exception_t& source) -> exception_dispatch_info {
66 return exception_dispatch_info {source};
72 [[nodiscard]]
static auto capture() -> exception_dispatch_info {
73 return exception_dispatch_info {std::current_exception()};
79 template<
class exception_t>
80 static auto rethrow(
const exception_t& source) ->
void {exception_dispatch_info {source}.rethrow();}
89 operator const std::exception_ptr& ()
const noexcept {
return exception_ptr_;}
90 operator std::exception_ptr () noexcept {
return exception_ptr_;}
94 template<
class exception_t>
95 exception_dispatch_info(
const exception_t& source) : source_ {source.template
memberwise_clone<exception_t>().
release()}, exception_ptr_ {std::make_exception_ptr(source)} {}
96 exception_dispatch_info(
const std::exception_ptr& exception_ptr) : exception_ptr_ {exception_ptr} {}
99 std::exception_ptr exception_ptr_;
Defines the base class for predefined exceptions in the xtd namespace.
Definition exception.hpp:29
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
xtd::unique_ptr_object< object_t > memberwise_clone() const
Creates a shallow copy of the current object.
static auto rethrow(const exception_t &source) -> void
Rehrows the source exception, maintaining the original stack trace information.
Definition exception_dispatch_info.hpp:80
auto rethrow() -> void
Rethrows the exception that's represented by the current xtd::runtime::exception_services::exception_...
Definition exception_dispatch_info.hpp:77
auto exception_captured() const noexcept -> bool
Gets a value indicating whether the exception is caught or not.
Definition exception_dispatch_info.hpp:47
static auto capture() -> exception_dispatch_info
Creates an xtd::runtime::exception_services::exception_dispatch_info object that represents the speci...
Definition exception_dispatch_info.hpp:72
static auto capture(const exception_t &source) -> exception_dispatch_info
Creates an xtd::runtime::exception_services::exception_dispatch_info object that represents the speci...
Definition exception_dispatch_info.hpp:65
auto source_exception() const noexcept -> xtd::ptr< xtd::exception >
Gets the exception that's represented by the current instance.
Definition exception_dispatch_info.hpp:52
Contains xtd::exception exception.
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
@ release
Build type release.
Definition build_type.hpp:24
Provides classes for advanced exception handling.
Definition exception_dispatch_info.hpp:15
Contains advanced types that support diverse namespaces such as the xtd, runtime, and the security na...
Definition exception_dispatch_info.hpp:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8