Shows how to use std::exception_ptr and invalid_operation_exception exception.
#include <xtd/threading/thread>
#include <xtd/console>
#include <xtd/invalid_operation_exception>
auto main() -> int {
auto exception_pointer = std::exception_ptr {};
try {
} catch (...) {
exception_pointer = std::current_exception();
}
}};
thread1.start();
thread1.join();
if (exception_pointer) {
try {
rethrow_exception(exception_pointer);
console::write_line(e);
}
}
}
The exception that is thrown when the format of an argument does not meet the parameter specification...
Definition invalid_operation_exception.hpp:19
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.hpp:18
Creates and controls a thread, sets its priority, and gets its status.
Definition thread.hpp:43
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10