Shows how to use system_exception exception.
#include <xtd/console>
#include <xtd/guid>
long create_handle() {
return reinterpret_cast<long>(
new guid());
}
void destroy_handle(long handle) {
delete reinterpret_cast<object*>(handle);
}
auto main() -> int {
try {
destroy_handle(handle);
}
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents a globally unique identifier (GUID). A GUID is a 128-bit integer (16 bytes) that can be us...
Definition guid.hpp:24
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.hpp:18
xtd::intptr handle() noexcept
Gets the thread handle of the current thread.
@ l
The L key.
Definition console_key.hpp:110
@ e
The E key.
Definition console_key.hpp:96
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8