33 exception_dispatch_info() =
default;
34 exception_dispatch_info(exception_dispatch_info&&) =
default;
35 exception_dispatch_info(
const exception_dispatch_info&) =
default;
36 auto operator =(exception_dispatch_info&&) -> exception_dispatch_info& =
default;
37 auto operator =(
const exception_dispatch_info&) -> exception_dispatch_info& =
default;
45 [[nodiscard]]
auto exception_captured() const noexcept ->
bool {
return exception_ptr_ ? true :
false;}
61 template<
class exception_t>
62 requires std::derived_from<exception_t, xtd::exception>
63 [[nodiscard]]
static auto capture(
const exception_t& source) -> exception_dispatch_info {
64 return exception_dispatch_info {source};
70 [[nodiscard]]
static auto capture() -> exception_dispatch_info {
71 return exception_dispatch_info {std::current_exception()};
77 template<
class exception_t>
78 static auto rethrow(
const exception_t& source) ->
void {exception_dispatch_info {source}.rethrow();}
87 operator const std::exception_ptr& ()
const noexcept {
return exception_ptr_;}
88 operator std::exception_ptr () noexcept {
return exception_ptr_;}
92 template<
class exception_t>
93 exception_dispatch_info(
const exception_t& source) : source_ {source.template
memberwise_clone<exception_t>().
release()}, exception_ptr_ {std::make_exception_ptr(source)} {}
94 exception_dispatch_info(
const std::exception_ptr& exception_ptr) : exception_ptr_ {exception_ptr} {}
97 std::exception_ptr exception_ptr_;
static auto capture(const exception_t &source) -> exception_dispatch_info
Creates an xtd::exception_services::exception_dispatch_info object that represents the specified exce...
Definition exception_dispatch_info.hpp:63
static auto capture() -> exception_dispatch_info
Creates an xtd::exception_services::exception_dispatch_info object that represents the specified exce...
Definition exception_dispatch_info.hpp:70
auto rethrow() -> void
Rethrows the exception that's represented by the current xtd::exception_services::exception_dispatch_...
Definition exception_dispatch_info.hpp:75
static auto rethrow(const exception_t &source) -> void
Rehrows the source exception, maintaining the original stack trace information.
Definition exception_dispatch_info.hpp:78
auto exception_captured() const noexcept -> bool
Gets a value indicating whether the exception is caught or not.
Definition exception_dispatch_info.hpp:45
auto source_exception() const noexcept -> xtd::ptr< xtd::exception >
Gets the exception that's represented by the current instance.
Definition exception_dispatch_info.hpp:50
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.
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:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8