Shows how to use system_exception exception.
#include <xtd/xtd>
long create_handle() {
return reinterpret_cast<long>(
new guid());
}
void destroy_handle(long handle) {
delete reinterpret_cast<object*>(handle);
}
auto main()->int {
try {
long handle = 0;
destroy_handle(handle);
}
}