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 a method call is invalid for the object's current state.
Definition invalid_operation_exception.h:19
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.h:18
Creates and controls a thread, sets its priority, and gets its status.
Definition thread.h:43
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10