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.join();
if (exception_pointer) {
try {
rethrow_exception(exception_pointer);
}
}
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
The exception that is thrown when the format of an argument does not meet the parameter specification...
Definition invalid_operation_exception.hpp:18
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:45
void start()
Causes the operating system to change the state of the current instance to xtd::threading::thread_sta...
@ e
The E key.
Definition console_key.hpp:96
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8